Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7216047a authored by Guang Zhu's avatar Guang Zhu
Browse files

Add checks for double-dumping on webkit data.

Also some logs seem to suggest that in rare occations, a webkit dump after timeout has occured actually never hears any response back from webkit, thus causing the test app to wait forever, because the request webkit data mechanism is not protected by a timeout watchdog. So adding a explicit log print before calling webkit dump for monitoring in future test runs.
parent 954e98e0
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -65,7 +65,13 @@ public class TestShellActivity extends Activity implements LayoutTestController
                mTimedOut = true;
                if(mCallback != null)
                    mCallback.timedOut(mWebView.getUrl());
                if(!mRequestedWebKitData) {
                    requestWebKitData();
                } else {
                    // if timed out and webkit data has been dumped before
                    // finish directly
                    finished();
                }
                return;
            } else if (msg.what == MSG_WEBKIT_DATA) {
                TestShellActivity.this.dump(mTimedOut, (String)msg.obj);
@@ -83,6 +89,7 @@ public class TestShellActivity extends Activity implements LayoutTestController
            throw new AssertionError("Requested webkit data twice: " + mWebView.getUrl());

        mRequestedWebKitData = true;
        Log.v(LOGTAG, "message sent to WebView to dump text.");
        switch (mDumpDataType) {
            case DUMP_AS_TEXT:
                mWebView.documentAsText(callback);