DO NOT MERGE Fix assertion to use complete load check rather than one flag.
Bug 6419879
Change-Id: I60c5701925dc1ce803879d0491dd8aac92a6759d
diff --git a/tests/src/android/webkit/cts/WebViewOnUiThread.java b/tests/src/android/webkit/cts/WebViewOnUiThread.java
index 0a1547e..bb07d08 100644
--- a/tests/src/android/webkit/cts/WebViewOnUiThread.java
+++ b/tests/src/android/webkit/cts/WebViewOnUiThread.java
@@ -661,12 +661,11 @@
* @param call The call to make on the UI thread prior to waiting.
*/
private void callAndWait(Runnable call) {
- 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);
- }
+ Assert.assertTrue("WebViewOnUiThread.load*AndWaitForCompletion calls "
+ + "may not be mixed with load* calls directly on WebView "
+ + "without calling waitForLoadCompletion after the load",
+ !isLoaded());
+ clearLoad(); // clear any extraneous signals from a previous load.
runOnUiThread(call);
waitForLoadCompletion();
}