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.VrTestRule.PAGE_LOAD_TIMEOUT_
S; | 7 import static org.chromium.chrome.browser.vr_shell.VrTestRule.PAGE_LOAD_TIMEOUT_
S; |
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 import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_V
IEWER_NON_DAYDREAM; | 10 import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_V
IEWER_NON_DAYDREAM; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 public VrTestRule mVrTestRule = new VrTestRule(); | 50 public VrTestRule mVrTestRule = new VrTestRule(); |
51 | 51 |
52 private ContentViewCore mFirstTabCvc; | 52 private ContentViewCore mFirstTabCvc; |
53 private WebContents mFirstTabWebContents; | 53 private WebContents mFirstTabWebContents; |
54 | 54 |
55 @Before | 55 @Before |
56 public void setUp() throws InterruptedException { | 56 public void setUp() throws InterruptedException { |
57 mActivityTestRule.startMainActivityOnBlankPage(); | 57 mActivityTestRule.startMainActivityOnBlankPage(); |
58 mFirstTabCvc = mActivityTestRule.getActivity().getActivityTab().getConte
ntViewCore(); | 58 mFirstTabCvc = mActivityTestRule.getActivity().getActivityTab().getConte
ntViewCore(); |
59 mFirstTabWebContents = mActivityTestRule.getActivity().getActivityTab().
getWebContents(); | 59 mFirstTabWebContents = mActivityTestRule.getActivity().getActivityTab().
getWebContents(); |
| 60 Assert.assertFalse("VrShellDelegate is in VR", VrShellDelegate.isInVr())
; |
60 } | 61 } |
61 | 62 |
62 /** | 63 /** |
63 * Tests that a successful requestPresent call actually enters VR | 64 * Tests that a successful requestPresent call actually enters VR |
64 */ | 65 */ |
65 @Test | 66 @Test |
66 @SmallTest | 67 @SmallTest |
67 public void testRequestPresentEntersVr() throws InterruptedException { | 68 public void testRequestPresentEntersVr() throws InterruptedException { |
68 mActivityTestRule.loadUrl( | 69 mActivityTestRule.loadUrl( |
69 VrTestRule.getHtmlTestFile("test_requestPresent_enters_vr"), PAG
E_LOAD_TIMEOUT_S); | 70 VrTestRule.getHtmlTestFile("test_requestPresent_enters_vr"), PAG
E_LOAD_TIMEOUT_S); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 @DisableIf.Build(message = "Flaky on L crbug.com/713781", | 304 @DisableIf.Build(message = "Flaky on L crbug.com/713781", |
304 sdk_is_greater_than = Build.VERSION_CODES.KITKAT, | 305 sdk_is_greater_than = Build.VERSION_CODES.KITKAT, |
305 sdk_is_less_than = Build.VERSION_CODES.M) | 306 sdk_is_less_than = Build.VERSION_CODES.M) |
306 public void testPresentationLocksFocus() throws InterruptedException { | 307 public void testPresentationLocksFocus() throws InterruptedException { |
307 mActivityTestRule.loadUrl( | 308 mActivityTestRule.loadUrl( |
308 VrTestRule.getHtmlTestFile("test_presentation_locks_focus"), PAG
E_LOAD_TIMEOUT_S); | 309 VrTestRule.getHtmlTestFile("test_presentation_locks_focus"), PAG
E_LOAD_TIMEOUT_S); |
309 mVrTestRule.enterPresentationAndWait(mFirstTabCvc, mFirstTabWebContents)
; | 310 mVrTestRule.enterPresentationAndWait(mFirstTabCvc, mFirstTabWebContents)
; |
310 mVrTestRule.endTest(mFirstTabWebContents); | 311 mVrTestRule.endTest(mFirstTabWebContents); |
311 } | 312 } |
312 } | 313 } |
OLD | NEW |