Commit a2259285 authored by bsheedy's avatar bsheedy Committed by Commit Bot

Fix testEnterVrInOverviewMode flakiness

Fixes VrShellTransitionTest#testEnterVrInOverviewMode being flaky due to
trying to call launchInVr with a null pointer for the launch intent.

Change-Id: Ic4b661fbf430e65a2a51923c2652a18acf11ac86
Reviewed-on: https://chromium-review.googlesource.com/912610Reviewed-by: default avatarBill Orr <billorr@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535920}
parent f53ef9e9
......@@ -308,6 +308,7 @@ public class VrShellTransitionTest {
Assert.assertTrue(activity.isInOverviewMode());
MockVrDaydreamApi mockApi = new MockVrDaydreamApi();
mockApi.setForwardSetupIntent(true);
VrShellDelegateUtils.getDelegateInstance().overrideDaydreamApiForTesting(mockApi);
Assert.assertTrue(VrTransitionUtils.forceEnterVr());
VrTransitionUtils.waitForVrEntry(POLL_TIMEOUT_LONG_MS);
......
......@@ -8,6 +8,8 @@ import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Intent;
import com.google.vr.ndk.base.DaydreamApi;
import org.chromium.chrome.browser.vr_shell.VrDaydreamApi;
/**
......@@ -17,6 +19,7 @@ public class MockVrDaydreamApi implements VrDaydreamApi {
private boolean mLaunchInVrCalled;
private boolean mExitFromVrCalled;
private boolean mLaunchVrHomescreenCalled;
private boolean mForwardSetupIntent;
@Override
public boolean isDaydreamReadyDevice() {
......@@ -88,6 +91,13 @@ public class MockVrDaydreamApi implements VrDaydreamApi {
@Override
public Intent setupVrIntent(Intent intent) {
if (mForwardSetupIntent) {
return DaydreamApi.setupVrIntent(intent);
}
return null;
}
public void setForwardSetupIntent(boolean forward) {
mForwardSetupIntent = forward;
}
}
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