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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java

Issue 2873843002: Support autopresenting WebVr content. (Closed)
Patch Set: rebase 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java ('k') | chrome/browser/about_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698