Loading tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -88,8 +88,9 @@ public class TestShellActivity extends Activity implements LayoutTestController } else if (msg.what == MSG_WEBKIT_DATA) { } else if (msg.what == MSG_WEBKIT_DATA) { TestShellActivity.this.dump(mTimedOut, (String)msg.obj); TestShellActivity.this.dump(mTimedOut, (String)msg.obj); return; return; } else if (msg.what == MSG_DUMP_TIMEOUT) { throw new RuntimeException("WebView dump timeout, is it pegged?"); } } super.handleMessage(msg); super.handleMessage(msg); } } } } Loading @@ -106,10 +107,12 @@ public class TestShellActivity extends Activity implements LayoutTestController case DUMP_AS_TEXT: case DUMP_AS_TEXT: callback.arg1 = mDumpTopFrameAsText ? 1 : 0; callback.arg1 = mDumpTopFrameAsText ? 1 : 0; callback.arg2 = mDumpChildFramesAsText ? 1 : 0; callback.arg2 = mDumpChildFramesAsText ? 1 : 0; setDumpTimeout(DUMP_TIMEOUT_MS); mWebView.documentAsText(callback); mWebView.documentAsText(callback); break; break; case EXT_REPR: case EXT_REPR: mWebView.externalRepresentation(callback); mWebView.externalRepresentation(callback); setDumpTimeout(DUMP_TIMEOUT_MS); break; break; default: default: finished(); finished(); Loading @@ -117,6 +120,11 @@ public class TestShellActivity extends Activity implements LayoutTestController } } } } private void setDumpTimeout(long timeout) { Message msg = mHandler.obtainMessage(MSG_DUMP_TIMEOUT); mHandler.sendMessageDelayed(msg, timeout); } public void clearCache() { public void clearCache() { mWebView.freeMemory(); mWebView.freeMemory(); } } Loading Loading @@ -933,9 +941,11 @@ public class TestShellActivity extends Activity implements LayoutTestController private boolean mDumpWebKitData = false; private boolean mDumpWebKitData = false; static final String TIMEOUT_STR = "**Test timeout"; static final String TIMEOUT_STR = "**Test timeout"; static final long DUMP_TIMEOUT_MS = 20000; //20s timeout for dumping webview content static final int MSG_TIMEOUT = 0; static final int MSG_TIMEOUT = 0; static final int MSG_WEBKIT_DATA = 1; static final int MSG_WEBKIT_DATA = 1; static final int MSG_DUMP_TIMEOUT = 2; static final String LOGTAG="TestShell"; static final String LOGTAG="TestShell"; Loading Loading
tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -88,8 +88,9 @@ public class TestShellActivity extends Activity implements LayoutTestController } else if (msg.what == MSG_WEBKIT_DATA) { } else if (msg.what == MSG_WEBKIT_DATA) { TestShellActivity.this.dump(mTimedOut, (String)msg.obj); TestShellActivity.this.dump(mTimedOut, (String)msg.obj); return; return; } else if (msg.what == MSG_DUMP_TIMEOUT) { throw new RuntimeException("WebView dump timeout, is it pegged?"); } } super.handleMessage(msg); super.handleMessage(msg); } } } } Loading @@ -106,10 +107,12 @@ public class TestShellActivity extends Activity implements LayoutTestController case DUMP_AS_TEXT: case DUMP_AS_TEXT: callback.arg1 = mDumpTopFrameAsText ? 1 : 0; callback.arg1 = mDumpTopFrameAsText ? 1 : 0; callback.arg2 = mDumpChildFramesAsText ? 1 : 0; callback.arg2 = mDumpChildFramesAsText ? 1 : 0; setDumpTimeout(DUMP_TIMEOUT_MS); mWebView.documentAsText(callback); mWebView.documentAsText(callback); break; break; case EXT_REPR: case EXT_REPR: mWebView.externalRepresentation(callback); mWebView.externalRepresentation(callback); setDumpTimeout(DUMP_TIMEOUT_MS); break; break; default: default: finished(); finished(); Loading @@ -117,6 +120,11 @@ public class TestShellActivity extends Activity implements LayoutTestController } } } } private void setDumpTimeout(long timeout) { Message msg = mHandler.obtainMessage(MSG_DUMP_TIMEOUT); mHandler.sendMessageDelayed(msg, timeout); } public void clearCache() { public void clearCache() { mWebView.freeMemory(); mWebView.freeMemory(); } } Loading Loading @@ -933,9 +941,11 @@ public class TestShellActivity extends Activity implements LayoutTestController private boolean mDumpWebKitData = false; private boolean mDumpWebKitData = false; static final String TIMEOUT_STR = "**Test timeout"; static final String TIMEOUT_STR = "**Test timeout"; static final long DUMP_TIMEOUT_MS = 20000; //20s timeout for dumping webview content static final int MSG_TIMEOUT = 0; static final int MSG_TIMEOUT = 0; static final int MSG_WEBKIT_DATA = 1; static final int MSG_WEBKIT_DATA = 1; static final int MSG_DUMP_TIMEOUT = 2; static final String LOGTAG="TestShell"; static final String LOGTAG="TestShell"; Loading