| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.vr_shell; | 5 package org.chromium.chrome.browser.vr_shell; |
| 6 | 6 |
| 7 import static org.chromium.chrome.browser.vr_shell.VrUtils.POLL_TIMEOUT_LONG_MS; | 7 import static org.chromium.chrome.browser.vr_shell.VrUtils.POLL_TIMEOUT_LONG_MS; |
| 8 import static org.chromium.chrome.browser.vr_shell.VrUtils.POLL_TIMEOUT_SHORT_MS
; | 8 import static org.chromium.chrome.browser.vr_shell.VrUtils.POLL_TIMEOUT_SHORT_MS
; |
| 9 import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_V
IEWER_DAYDREAM; | 9 import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_V
IEWER_DAYDREAM; |
| 10 | 10 |
| 11 import android.support.test.filters.MediumTest; | 11 import android.support.test.filters.MediumTest; |
| 12 | 12 |
| 13 import org.junit.Assert; |
| 14 import org.junit.Before; |
| 15 import org.junit.Rule; |
| 16 import org.junit.Test; |
| 17 import org.junit.runner.RunWith; |
| 18 |
| 13 import org.chromium.base.test.util.CommandLineFlags; | 19 import org.chromium.base.test.util.CommandLineFlags; |
| 14 import org.chromium.base.test.util.Restriction; | 20 import org.chromium.base.test.util.Restriction; |
| 21 import org.chromium.chrome.browser.ChromeSwitches; |
| 22 import org.chromium.chrome.browser.ChromeTabbedActivity; |
| 23 import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
| 24 import org.chromium.chrome.test.ChromeActivityTestRule; |
| 25 import org.chromium.chrome.test.ChromeJUnit4ClassRunner; |
| 26 import org.chromium.chrome.test.ChromeTabbedActivityTestRule; |
| 15 import org.chromium.chrome.test.util.ChromeTabUtils; | 27 import org.chromium.chrome.test.util.ChromeTabUtils; |
| 16 import org.chromium.content.browser.ContentViewCore; | 28 import org.chromium.content.browser.ContentViewCore; |
| 17 import org.chromium.content.browser.test.util.DOMUtils; | 29 import org.chromium.content.browser.test.util.DOMUtils; |
| 18 import org.chromium.content_public.browser.WebContents; | 30 import org.chromium.content_public.browser.WebContents; |
| 19 | 31 |
| 20 import java.util.concurrent.TimeoutException; | 32 import java.util.concurrent.TimeoutException; |
| 21 | 33 |
| 22 /** | 34 /** |
| 23 * End-to-end tests for testing navigation transitions (e.g. link clicking) in V
R Browser mode, aka | 35 * End-to-end tests for testing navigation transitions (e.g. link clicking) in V
R Browser mode, aka |
| 24 * "VR Shell". This may require interacting with WebVR in addition to the VR bro
wser, so inherit | 36 * "VR Shell". This may require interacting with WebVR in addition to the VR bro
wser, so inherit |
| 25 * from VrTestBase for the WebVR test framework. | 37 * from VrTestBase for the WebVR test framework. |
| 26 */ | 38 */ |
| 39 @RunWith(ChromeJUnit4ClassRunner.class) |
| 40 @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, |
| 41 ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG, "enable-features
=VrShell"}) |
| 27 @Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM) | 42 @Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM) |
| 28 @CommandLineFlags.Add("enable-features=VrShell") | 43 |
| 29 public class VrShellNavigationTest extends VrTestBase { | 44 public class VrShellNavigationTest { |
| 45 @Rule |
| 46 public VrTestRule mVrTestRule = new VrTestRule(); |
| 47 |
| 48 @Rule |
| 49 public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActi
vityTestRule(); |
| 50 |
| 30 private static final String TEST_PAGE_2D_URL = | 51 private static final String TEST_PAGE_2D_URL = |
| 31 VrTestBase.getHtmlTestFile("test_navigation_2d_page"); | 52 VrTestRule.getHtmlTestFile("test_navigation_2d_page"); |
| 32 private static final String TEST_PAGE_WEBVR_URL = | 53 private static final String TEST_PAGE_WEBVR_URL = |
| 33 VrTestBase.getHtmlTestFile("test_navigation_webvr_page"); | 54 VrTestRule.getHtmlTestFile("test_navigation_webvr_page"); |
| 34 | 55 |
| 35 private enum Page { PAGE_2D, PAGE_WEBVR } | 56 private enum Page { PAGE_2D, PAGE_WEBVR } |
| 36 private enum PresentationMode { NON_PRESENTING, PRESENTING } | 57 private enum PresentationMode { NON_PRESENTING, PRESENTING } |
| 37 private enum FullscreenMode { NON_FULLSCREENED, FULLSCREENED } | 58 private enum FullscreenMode { NON_FULLSCREENED, FULLSCREENED } |
| 38 | 59 |
| 39 private String getUrl(Page page) { | 60 private String getUrl(Page page) { |
| 40 switch (page) { | 61 switch (page) { |
| 41 case PAGE_2D: | 62 case PAGE_2D: |
| 42 return TEST_PAGE_2D_URL + "?id=0"; | 63 return TEST_PAGE_2D_URL + "?id=0"; |
| 43 case PAGE_WEBVR: | 64 case PAGE_WEBVR: |
| 44 return TEST_PAGE_WEBVR_URL + "?id=0"; | 65 return TEST_PAGE_WEBVR_URL + "?id=0"; |
| 45 default: | 66 default: |
| 46 throw new UnsupportedOperationException("Don't know page type "
+ page); | 67 throw new UnsupportedOperationException("Don't know page type "
+ page); |
| 47 } | 68 } |
| 48 } | 69 } |
| 49 | 70 |
| 50 /** | 71 /** |
| 51 * Triggers navigation to either a 2D or WebVR page. Similar to | 72 * Triggers navigation to either a 2D or WebVR page. Similar to |
| 52 * {@link ChromeActivityTestCaseBase#loadUrl loadUrl} but makes sure page in
itiates the | 73 * {@link ChromeActivityTestCaseBase#loadUrl loadUrl} but makes sure page in
itiates the |
| 53 * navigation. This is desirable since we are testing navigation transitions
end-to-end. | 74 * navigation. This is desirable since we are testing navigation transitions
end-to-end. |
| 54 */ | 75 */ |
| 55 private void navigateTo(final Page to) throws InterruptedException { | 76 private void navigateTo(final Page to) throws InterruptedException { |
| 56 ChromeTabUtils.waitForTabPageLoaded(getActivity().getActivityTab(), new
Runnable() { | 77 ChromeTabUtils.waitForTabPageLoaded( |
| 57 @Override | 78 mActivityTestRule.getActivity().getActivityTab(), new Runnable()
{ |
| 58 public void run() { | 79 @Override |
| 59 runJavaScriptOrFail("window.location.href = '" + getUrl(to) + "'
;", | 80 public void run() { |
| 60 POLL_TIMEOUT_SHORT_MS, mWebContents); | 81 mVrTestRule.runJavaScriptOrFail( |
| 61 } | 82 "window.location.href = '" + getUrl(to) + "';", |
| 62 }, POLL_TIMEOUT_LONG_MS); | 83 POLL_TIMEOUT_SHORT_MS, mActivityTestRule.getActi
vity()); |
| 84 } |
| 85 }, POLL_TIMEOUT_LONG_MS); |
| 63 } | 86 } |
| 64 | 87 |
| 65 private void enterFullscreen(ContentViewCore cvc) | 88 private void enterFullscreen() throws InterruptedException, TimeoutException
{ |
| 66 throws InterruptedException, TimeoutException { | 89 ChromeTabbedActivity activity = mActivityTestRule.getActivity(); |
| 90 ContentViewCore cvc = activity.getActivityTab().getContentViewCore(); |
| 67 DOMUtils.clickNode(cvc, "fullscreen"); | 91 DOMUtils.clickNode(cvc, "fullscreen"); |
| 68 waitOnJavaScriptStep(cvc.getWebContents()); | 92 mVrTestRule.waitOnJavaScriptStep(activity); |
| 69 assertTrue(DOMUtils.isFullscreen(cvc.getWebContents())); | 93 Assert.assertTrue(DOMUtils.isFullscreen(cvc.getWebContents())); |
| 70 } | 94 } |
| 71 | 95 |
| 72 private void enterPresentation(ContentViewCore cvc) | 96 private void enterPresentation() throws InterruptedException, TimeoutExcepti
on { |
| 73 throws InterruptedException, TimeoutException { | 97 ContentViewCore cvc = mActivityTestRule.getActivity().getActivityTab().g
etContentViewCore(); |
| 74 // TODO(bsheedy): check if we could use DOMUtils.clickNode in VrTestBase
#enterVrTap and | 98 // TODO(bsheedy): check if we could use DOMUtils.clickNode in VrTestBase
#enterVrTap and |
| 75 // then use VrTestBase#enterVrTap here. | 99 // then use VrTestBase#enterVrTap here. |
| 76 DOMUtils.clickNode(cvc, "webgl-canvas"); | 100 DOMUtils.clickNode(cvc, "webgl-canvas"); |
| 77 waitOnJavaScriptStep(mWebContents); | 101 mVrTestRule.waitOnJavaScriptStep(mActivityTestRule.getActivity()); |
| 78 assertTrue(VrShellDelegate.getVrShellForTesting().getWebVrModeEnabled())
; | 102 Assert.assertTrue(VrShellDelegate.getVrShellForTesting().getWebVrModeEna
bled()); |
| 79 } | 103 } |
| 80 | 104 |
| 81 private void assertState(WebContents wc, Page page, PresentationMode present
ationMode, | 105 private void assertState(ChromeTabbedActivity activity, Page page, |
| 82 FullscreenMode fullscreenMode) throws InterruptedException, TimeoutE
xception { | 106 PresentationMode presentationMode, FullscreenMode fullscreenMode) |
| 83 assertTrue("Browser is in VR", VrShellDelegate.isInVr()); | 107 throws InterruptedException, TimeoutException { |
| 84 assertEquals("Browser is on correct web site", getUrl(page), wc.getVisib
leUrl()); | 108 WebContents wc = activity.getActivityTab().getWebContents(); |
| 85 assertEquals("Browser is in VR Presentation Mode", | 109 Assert.assertTrue("Browser is in VR", VrShellDelegate.isInVr()); |
| 110 Assert.assertEquals("Browser is on correct web site", getUrl(page), wc.g
etVisibleUrl()); |
| 111 Assert.assertEquals("Browser is in VR Presentation Mode", |
| 86 presentationMode == PresentationMode.PRESENTING, | 112 presentationMode == PresentationMode.PRESENTING, |
| 87 VrShellDelegate.getVrShellForTesting().getWebVrModeEnabled()); | 113 VrShellDelegate.getVrShellForTesting().getWebVrModeEnabled()); |
| 88 assertEquals("Browser is in fullscreen", fullscreenMode == FullscreenMod
e.FULLSCREENED, | 114 Assert.assertEquals("Browser is in fullscreen", |
| 89 DOMUtils.isFullscreen(wc)); | 115 fullscreenMode == FullscreenMode.FULLSCREENED, DOMUtils.isFullsc
reen(wc)); |
| 90 } | 116 } |
| 91 | 117 |
| 92 @Override | |
| 93 public int loadUrl(String url, long secondsToWait) | 118 public int loadUrl(String url, long secondsToWait) |
| 94 throws IllegalArgumentException, InterruptedException { | 119 throws IllegalArgumentException, InterruptedException { |
| 95 int result = super.loadUrl(url, secondsToWait); | 120 int result = mActivityTestRule.loadUrl(url, secondsToWait); |
| 96 waitOnJavaScriptStep(getActivity().getActivityTab().getWebContents()); | 121 mVrTestRule.waitOnJavaScriptStep(mActivityTestRule.getActivity()); |
| 97 return result; | 122 return result; |
| 98 } | 123 } |
| 99 | 124 |
| 100 @Override | 125 @Before |
| 101 protected void setUp() throws Exception { | 126 public void setUp() throws Exception { |
| 102 super.setUp(); | |
| 103 VrUtils.forceEnterVr(); | 127 VrUtils.forceEnterVr(); |
| 104 VrUtils.waitForVrSupported(POLL_TIMEOUT_LONG_MS); | 128 VrUtils.waitForVrSupported(POLL_TIMEOUT_LONG_MS); |
| 105 } | 129 } |
| 106 | 130 |
| 107 /** | 131 /** |
| 108 * Tests navigation from a 2D to a 2D page. | 132 * Tests navigation from a 2D to a 2D page. |
| 109 */ | 133 */ |
| 134 @Test |
| 110 @MediumTest | 135 @MediumTest |
| 111 public void test2dTo2d() throws InterruptedException, TimeoutException { | 136 public void test2dTo2d() throws InterruptedException, TimeoutException { |
| 112 loadUrl(TEST_PAGE_2D_URL, PAGE_LOAD_TIMEOUT_S); | 137 loadUrl(TEST_PAGE_2D_URL, VrTestRule.PAGE_LOAD_TIMEOUT_S); |
| 113 | 138 |
| 114 navigateTo(Page.PAGE_2D); | 139 navigateTo(Page.PAGE_2D); |
| 115 | 140 |
| 116 assertState(mWebContents, Page.PAGE_2D, PresentationMode.NON_PRESENTING, | 141 assertState(mActivityTestRule.getActivity(), Page.PAGE_2D, PresentationM
ode.NON_PRESENTING, |
| 117 FullscreenMode.NON_FULLSCREENED); | 142 FullscreenMode.NON_FULLSCREENED); |
| 118 } | 143 } |
| 119 | 144 |
| 120 /** | 145 /** |
| 121 * Tests navigation from a 2D to a WebVR page. | 146 * Tests navigation from a 2D to a WebVR page. |
| 122 */ | 147 */ |
| 148 @Test |
| 123 @CommandLineFlags.Add("enable-webvr") | 149 @CommandLineFlags.Add("enable-webvr") |
| 124 @MediumTest | 150 @MediumTest |
| 125 public void test2dToWebVr() | 151 public void test2dToWebVr() |
| 126 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { | 152 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { |
| 127 loadUrl(TEST_PAGE_2D_URL, PAGE_LOAD_TIMEOUT_S); | 153 loadUrl(TEST_PAGE_2D_URL, VrTestRule.PAGE_LOAD_TIMEOUT_S); |
| 128 | 154 |
| 129 navigateTo(Page.PAGE_WEBVR); | 155 navigateTo(Page.PAGE_WEBVR); |
| 130 | 156 |
| 131 assertState(mWebContents, Page.PAGE_WEBVR, PresentationMode.NON_PRESENTI
NG, | 157 assertState(mActivityTestRule.getActivity(), Page.PAGE_WEBVR, |
| 132 FullscreenMode.NON_FULLSCREENED); | 158 PresentationMode.NON_PRESENTING, FullscreenMode.NON_FULLSCREENED
); |
| 133 } | 159 } |
| 134 | 160 |
| 135 /** | 161 /** |
| 136 * Tests navigation from a fullscreened 2D to a WebVR page. | 162 * Tests navigation from a fullscreened 2D to a WebVR page. |
| 137 */ | 163 */ |
| 164 @Test |
| 138 @CommandLineFlags.Add("enable-webvr") | 165 @CommandLineFlags.Add("enable-webvr") |
| 139 @MediumTest | 166 @MediumTest |
| 140 public void test2dFullscreenToWebVr() | 167 public void test2dFullscreenToWebVr() |
| 141 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { | 168 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { |
| 142 loadUrl(TEST_PAGE_2D_URL, PAGE_LOAD_TIMEOUT_S); | 169 loadUrl(TEST_PAGE_2D_URL, VrTestRule.PAGE_LOAD_TIMEOUT_S); |
| 143 enterFullscreen(getActivity().getActivityTab().getContentViewCore()); | 170 enterFullscreen(); |
| 144 | 171 |
| 145 navigateTo(Page.PAGE_WEBVR); | 172 navigateTo(Page.PAGE_WEBVR); |
| 146 | 173 |
| 147 assertState(mWebContents, Page.PAGE_WEBVR, PresentationMode.NON_PRESENTI
NG, | 174 assertState(mActivityTestRule.getActivity(), Page.PAGE_WEBVR, |
| 148 FullscreenMode.NON_FULLSCREENED); | 175 PresentationMode.NON_PRESENTING, FullscreenMode.NON_FULLSCREENED
); |
| 149 } | 176 } |
| 150 | 177 |
| 151 /** | 178 /** |
| 152 * Tests navigation from a WebVR to a 2D page. | 179 * Tests navigation from a WebVR to a 2D page. |
| 153 */ | 180 */ |
| 181 @Test |
| 154 @CommandLineFlags.Add("enable-webvr") | 182 @CommandLineFlags.Add("enable-webvr") |
| 155 @MediumTest | 183 @MediumTest |
| 156 public void testWebVrTo2d() | 184 public void testWebVrTo2d() |
| 157 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { | 185 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { |
| 158 loadUrl(TEST_PAGE_WEBVR_URL, PAGE_LOAD_TIMEOUT_S); | 186 loadUrl(TEST_PAGE_WEBVR_URL, VrTestRule.PAGE_LOAD_TIMEOUT_S); |
| 159 | 187 |
| 160 navigateTo(Page.PAGE_2D); | 188 navigateTo(Page.PAGE_2D); |
| 161 | 189 |
| 162 assertState(mWebContents, Page.PAGE_2D, PresentationMode.NON_PRESENTING, | 190 assertState(mActivityTestRule.getActivity(), Page.PAGE_2D, PresentationM
ode.NON_PRESENTING, |
| 163 FullscreenMode.NON_FULLSCREENED); | 191 FullscreenMode.NON_FULLSCREENED); |
| 164 } | 192 } |
| 165 | 193 |
| 166 /** | 194 /** |
| 167 * Tests navigation from a WebVR to a WebVR page. | 195 * Tests navigation from a WebVR to a WebVR page. |
| 168 */ | 196 */ |
| 197 @Test |
| 169 @CommandLineFlags.Add("enable-webvr") | 198 @CommandLineFlags.Add("enable-webvr") |
| 170 @MediumTest | 199 @MediumTest |
| 171 public void testWebVrToWebVr() | 200 public void testWebVrToWebVr() |
| 172 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { | 201 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { |
| 173 loadUrl(TEST_PAGE_WEBVR_URL, PAGE_LOAD_TIMEOUT_S); | 202 loadUrl(TEST_PAGE_WEBVR_URL, VrTestRule.PAGE_LOAD_TIMEOUT_S); |
| 174 | 203 |
| 175 navigateTo(Page.PAGE_WEBVR); | 204 navigateTo(Page.PAGE_WEBVR); |
| 176 | 205 |
| 177 assertState(mWebContents, Page.PAGE_WEBVR, PresentationMode.NON_PRESENTI
NG, | 206 assertState(mActivityTestRule.getActivity(), Page.PAGE_WEBVR, |
| 178 FullscreenMode.NON_FULLSCREENED); | 207 PresentationMode.NON_PRESENTING, FullscreenMode.NON_FULLSCREENED
); |
| 179 } | 208 } |
| 180 | 209 |
| 181 /** | 210 /** |
| 182 * Tests navigation from a presenting WebVR to a 2D page. | 211 * Tests navigation from a presenting WebVR to a 2D page. |
| 183 */ | 212 */ |
| 213 @Test |
| 184 @CommandLineFlags.Add("enable-webvr") | 214 @CommandLineFlags.Add("enable-webvr") |
| 185 @MediumTest | 215 @MediumTest |
| 186 public void testWebVrPresentingTo2d() | 216 public void testWebVrPresentingTo2d() |
| 187 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { | 217 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { |
| 188 loadUrl(TEST_PAGE_WEBVR_URL, PAGE_LOAD_TIMEOUT_S); | 218 loadUrl(TEST_PAGE_WEBVR_URL, VrTestRule.PAGE_LOAD_TIMEOUT_S); |
| 189 enterPresentation(getActivity().getActivityTab().getContentViewCore()); | 219 enterPresentation(); |
| 190 | 220 |
| 191 navigateTo(Page.PAGE_2D); | 221 navigateTo(Page.PAGE_2D); |
| 192 | 222 |
| 193 assertState(mWebContents, Page.PAGE_2D, PresentationMode.NON_PRESENTING, | 223 assertState(mActivityTestRule.getActivity(), Page.PAGE_2D, PresentationM
ode.NON_PRESENTING, |
| 194 FullscreenMode.NON_FULLSCREENED); | 224 FullscreenMode.NON_FULLSCREENED); |
| 195 } | 225 } |
| 196 | 226 |
| 197 /** | 227 /** |
| 198 * Tests navigation from a presenting WebVR to a WebVR page. | 228 * Tests navigation from a presenting WebVR to a WebVR page. |
| 199 */ | 229 */ |
| 230 @Test |
| 200 @CommandLineFlags.Add("enable-webvr") | 231 @CommandLineFlags.Add("enable-webvr") |
| 201 @MediumTest | 232 @MediumTest |
| 202 public void testWebVrPresentingToWebVr() | 233 public void testWebVrPresentingToWebVr() |
| 203 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { | 234 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { |
| 204 loadUrl(TEST_PAGE_WEBVR_URL, PAGE_LOAD_TIMEOUT_S); | 235 loadUrl(TEST_PAGE_WEBVR_URL, VrTestRule.PAGE_LOAD_TIMEOUT_S); |
| 205 enterPresentation(getActivity().getActivityTab().getContentViewCore()); | 236 enterPresentation(); |
| 206 | 237 |
| 207 navigateTo(Page.PAGE_WEBVR); | 238 navigateTo(Page.PAGE_WEBVR); |
| 208 | 239 |
| 209 assertState(mWebContents, Page.PAGE_WEBVR, PresentationMode.NON_PRESENTI
NG, | 240 assertState(mActivityTestRule.getActivity(), Page.PAGE_WEBVR, |
| 210 FullscreenMode.NON_FULLSCREENED); | 241 PresentationMode.NON_PRESENTING, FullscreenMode.NON_FULLSCREENED
); |
| 211 } | 242 } |
| 212 | 243 |
| 213 /** | 244 /** |
| 214 * Tests navigation from a fullscreened WebVR to a 2D page. | 245 * Tests navigation from a fullscreened WebVR to a 2D page. |
| 215 */ | 246 */ |
| 247 @Test |
| 216 @CommandLineFlags.Add("enable-webvr") | 248 @CommandLineFlags.Add("enable-webvr") |
| 217 @MediumTest | 249 @MediumTest |
| 218 public void testWebVrFullscreenTo2d() | 250 public void testWebVrFullscreenTo2d() |
| 219 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { | 251 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { |
| 220 loadUrl(TEST_PAGE_WEBVR_URL, PAGE_LOAD_TIMEOUT_S); | 252 loadUrl(TEST_PAGE_WEBVR_URL, VrTestRule.PAGE_LOAD_TIMEOUT_S); |
| 221 enterFullscreen(getActivity().getActivityTab().getContentViewCore()); | 253 enterFullscreen(); |
| 222 | 254 |
| 223 navigateTo(Page.PAGE_2D); | 255 navigateTo(Page.PAGE_2D); |
| 224 | 256 |
| 225 assertState(mWebContents, Page.PAGE_2D, PresentationMode.NON_PRESENTING, | 257 assertState(mActivityTestRule.getActivity(), Page.PAGE_2D, PresentationM
ode.NON_PRESENTING, |
| 226 FullscreenMode.NON_FULLSCREENED); | 258 FullscreenMode.NON_FULLSCREENED); |
| 227 } | 259 } |
| 228 | 260 |
| 229 /** | 261 /** |
| 230 * Tests navigation from a fullscreened WebVR to a WebVR page. | 262 * Tests navigation from a fullscreened WebVR to a WebVR page. |
| 231 */ | 263 */ |
| 264 @Test |
| 232 @CommandLineFlags.Add("enable-webvr") | 265 @CommandLineFlags.Add("enable-webvr") |
| 233 @MediumTest | 266 @MediumTest |
| 234 public void testWebVrFullscreenToWebVr() | 267 public void testWebVrFullscreenToWebVr() |
| 235 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { | 268 throws IllegalArgumentException, InterruptedException, TimeoutExcept
ion { |
| 236 loadUrl(TEST_PAGE_WEBVR_URL, PAGE_LOAD_TIMEOUT_S); | 269 loadUrl(TEST_PAGE_WEBVR_URL, VrTestRule.PAGE_LOAD_TIMEOUT_S); |
| 237 enterFullscreen(getActivity().getActivityTab().getContentViewCore()); | 270 enterFullscreen(); |
| 238 | 271 |
| 239 navigateTo(Page.PAGE_WEBVR); | 272 navigateTo(Page.PAGE_WEBVR); |
| 240 | 273 |
| 241 assertState(mWebContents, Page.PAGE_WEBVR, PresentationMode.NON_PRESENTI
NG, | 274 assertState(mActivityTestRule.getActivity(), Page.PAGE_WEBVR, |
| 242 FullscreenMode.NON_FULLSCREENED); | 275 PresentationMode.NON_PRESENTING, FullscreenMode.NON_FULLSCREENED
); |
| 243 } | 276 } |
| 244 } | 277 } |
| OLD | NEW |