From 3cf18f5c9697273e34acfaf7536cc472c97ee3fa Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 22 Sep 2010 15:41:05 +0100 Subject: [PATCH] Fix DumpRenderTree2 to wait for the WebCore thread to become ready This is required to make sure that the WebCore thread's message handlers are ready to receive settings. Change-Id: I2c4df95e3b7409535b739ada957d93a7e6cd78d6 --- .../com/android/dumprendertree2/LayoutTestsExecutor.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java index c0ba9e5871058..000770e4b5a59 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java @@ -327,6 +327,13 @@ public class LayoutTestsExecutor extends Activity { mCurrentAdditionalTextOutput = null; mCurrentWebView = createWebViewWithJavascriptInterfaces(); + // When we create the first WebView, we need to pause to wait for the WebView thread to spin + // and up and for it to register its message handlers. + if (previousWebView == null) { + try { + Thread.currentThread().sleep(1000); + } catch (Exception e) {} + } setupWebView(mCurrentWebView); mEventSender.reset(mCurrentWebView);