Commit 400ad594 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[vr] Fix XR test workaround for loadUrl

The existing XR test workaround (crrev.com/c/1306173) checks for the
existence of isInitializationComplete by attempting to access it.
However, accessing an undeclared variable throws a ReferenceError -- the
correct way of checking for its existence is using typeof.

Bug: 894796
Change-Id: I86a5ac2ba45fea5e51c7e0f9fddc4167b8772443
Reviewed-on: https://chromium-review.googlesource.com/c/1319715Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605771}
parent e0f9b7e9
......@@ -395,10 +395,11 @@ public abstract class XrTestFramework {
public int loadUrlAndAwaitInitialization(String url, int timeoutSec)
throws InterruptedException {
int result = mRule.loadUrl(url, timeoutSec);
// TODO(https://crbug.com/894796): Remove the first isInitializationComplete once loadUrl
// is fixed.
// TODO(https://crbug.com/894796): Remove the isInitializationComplete undefined check once
// loadUrl is fixed.
Assert.assertTrue("Timed out waiting for JavaScript test initialization",
pollJavaScriptBoolean("isInitializationComplete && isInitializationComplete()",
pollJavaScriptBoolean("(typeof isInitializationComplete !== 'undefined') && "
+ "isInitializationComplete()",
POLL_TIMEOUT_LONG_MS, mRule.getWebContents()));
return result;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment