OSDN Git Service

Add checks for double-dumping on webkit data.
authorGuang Zhu <guangzhu@google.com>
Sat, 26 Sep 2009 00:34:12 +0000 (17:34 -0700)
committerGuang Zhu <guangzhu@google.com>
Mon, 28 Sep 2009 16:20:20 +0000 (09:20 -0700)
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.

tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java

index 39b8774..5a8cf2a 100644 (file)
@@ -65,7 +65,13 @@ public class TestShellActivity extends Activity implements LayoutTestController
                 mTimedOut = true;
                 if(mCallback != null)
                     mCallback.timedOut(mWebView.getUrl());
-                requestWebKitData();
+                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);