Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3953)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellTest.java

Issue 2727873002: Implement lazy initialization for VrShellDelegate (Closed)
Patch Set: Fix FindBugs errors - neat! Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellTest.java
index 331ef5da2bce0b7d92994a4988f3cd1b98b67a1d..dee0498f6d8410847837752658c55f44231c9df4 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellTest.java
@@ -46,7 +46,7 @@ public class VrShellTest extends ChromeTabbedActivityTestBase {
@Override
protected void setUp() throws Exception {
super.setUp();
- mDelegate = getActivity().getVrShellDelegate();
+ mDelegate = VrShellDelegate.getInstanceForTesting();
}
@Override
@@ -61,16 +61,16 @@ public class VrShellTest extends ChromeTabbedActivityTestBase {
if (!supported) {
mDelegate.overrideDaydreamApiForTesting(mockApi);
}
- VrUtils.forceEnterVr(mDelegate);
+ VrUtils.forceEnterVr();
if (supported) {
- VrUtils.waitForVrSupported(mDelegate);
- assertTrue(mDelegate.isInVR());
+ VrUtils.waitForVrSupported();
+ assertTrue(VrShellDelegate.isInVR());
} else {
assertFalse(mockApi.getLaunchInVrCalled());
- assertFalse(mDelegate.isInVR());
+ assertFalse(VrShellDelegate.isInVR());
}
VrUtils.forceExitVr(mDelegate);
- assertFalse(mDelegate.isInVR());
+ assertFalse(VrShellDelegate.isInVR());
}
private void enterExitVrModeImage(boolean supported) throws IOException {
@@ -81,7 +81,7 @@ public class VrShellTest extends ChromeTabbedActivityTestBase {
getActivity().getWindow().getDecorView().getRootView(),
"blank_page");
- VrUtils.forceEnterVr(mDelegate);
+ VrUtils.forceEnterVr();
// Currently, screenshots only show the static UI overlay, not the
// actual content. Thus, 1:1 pixel checking is reliable until a
// way to take screenshots of VR content is added, in which case
@@ -89,7 +89,7 @@ public class VrShellTest extends ChromeTabbedActivityTestBase {
// assuming that if the UI overlay is visible, then the device has
// successfully entered VR mode.
if (supported) {
- VrUtils.waitForVrSupported(mDelegate);
+ VrUtils.waitForVrSupported();
mViewRenderer.renderAndCompare(
getActivity().getWindow().getDecorView().getRootView(),
"vr_entered");
@@ -115,10 +115,10 @@ public class VrShellTest extends ChromeTabbedActivityTestBase {
getInstrumentation().waitForIdleSync();
VrUtils.simNfc(getActivity());
if (supported) {
- VrUtils.waitForVrSupported(mDelegate);
- assertTrue(mDelegate.isInVR());
+ VrUtils.waitForVrSupported();
+ assertTrue(VrShellDelegate.isInVR());
} else {
- assertFalse(mDelegate.isInVR());
+ assertFalse(VrShellDelegate.isInVR());
}
VrUtils.forceExitVr(mDelegate);
// TODO(bsheedy): Figure out why NFC tests cause the next test to fail

Powered by Google App Engine
This is Rietveld 408576698