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

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

Issue 2918853002: Add test for validating the proper size when we exit WebVR to VR browsing. (Closed)
Patch Set: CR feedback Created 3 years, 7 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java
index d6e9154e8d2951775b31ae724934649c5a77364f..69cabcc4b8ba67489950eebe48ad9f4fe0ef2e61 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java
@@ -27,6 +27,7 @@ import org.chromium.chrome.test.util.ChromeTabUtils;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content_public.browser.WebContents;
+import org.chromium.ui.display.DisplayAndroid;
import java.util.concurrent.TimeoutException;
@@ -260,4 +261,36 @@ public class VrShellNavigationTest {
assertState(mVrTestRule.getFirstTabWebContents(), Page.PAGE_WEBVR,
PresentationMode.NON_PRESENTING, FullscreenMode.NON_FULLSCREENED);
}
+
+ /**
+ * Tests exit presentation transition from WebVR to VrShell
+ */
+ @Test
+ @CommandLineFlags.Add("enable-webvr")
+ @MediumTest
+ public void testExitPresentationWebVrToVrShell()
tiborg 2017/06/02 15:36:51 This test should probably not be here. VrShellTest
+ throws IllegalArgumentException, InterruptedException, TimeoutException {
+ mVrTestRule.loadUrlAndAwaitInitialization(TEST_PAGE_WEBVR_URL, PAGE_LOAD_TIMEOUT_S);
+ enterPresentationOrFail(mVrTestRule.getFirstTabCvc());
+
+ // Validate our size is what we expect.
+ DisplayAndroid primaryDisplay =
+ DisplayAndroid.getNonMultiDisplay(mVrTestRule.getActivity());
+ float expectedWidth = primaryDisplay.getDisplayWidth();
+ float expectedHeight = primaryDisplay.getDisplayHeight();
+ Assert.assertTrue(mVrTestRule.pollJavaScriptBoolean(
+ "screen.width == " + expectedWidth + " && screen.height == " + expectedHeight,
+ POLL_TIMEOUT_LONG_MS, mVrTestRule.getFirstTabWebContents()));
+
+ // Exit presentation through JavaScript.
+ mVrTestRule.runJavaScriptOrFail("vrDisplay.exitPresent();", POLL_TIMEOUT_SHORT_MS,
+ mVrTestRule.getFirstTabWebContents());
+
+ // Validate our size is what we expect.
+ expectedWidth = VrShellImpl.DEFAULT_CONTENT_WIDTH;
+ expectedHeight = VrShellImpl.DEFAULT_CONTENT_HEIGHT;
+ Assert.assertTrue(mVrTestRule.pollJavaScriptBoolean(
+ "screen.width == " + expectedWidth + " && screen.height == " + expectedHeight,
+ POLL_TIMEOUT_LONG_MS, mVrTestRule.getFirstTabWebContents()));
+ }
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698