Merge "DO NOT MERGE Close hole in synchronize-protected member variable." into jb-dev
diff --git a/tests/src/android/webkit/cts/WebViewOnUiThread.java b/tests/src/android/webkit/cts/WebViewOnUiThread.java
index 895022a..0a1547e 100644
--- a/tests/src/android/webkit/cts/WebViewOnUiThread.java
+++ b/tests/src/android/webkit/cts/WebViewOnUiThread.java
@@ -661,10 +661,12 @@
* @param call The call to make on the UI thread prior to waiting.
*/
private void callAndWait(Runnable call) {
- Assert.assertTrue("WebViewOnUiThread.load*AndWaitForCompletion calls "
- + "may not be mixed with load* calls directly on WebView "
- + "without calling waitForLoadCompletion after the load",
- !mLoaded);
+ synchronized (this) {
+ Assert.assertTrue("WebViewOnUiThread.load*AndWaitForCompletion calls "
+ + "may not be mixed with load* calls directly on WebView "
+ + "without calling waitForLoadCompletion after the load",
+ !mLoaded);
+ }
runOnUiThread(call);
waitForLoadCompletion();
}