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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.content.Intent; | 7 import android.content.Intent; |
8 import android.content.pm.ActivityInfo; | 8 import android.content.pm.ActivityInfo; |
9 import android.net.Uri; | 9 import android.net.Uri; |
10 import android.support.test.InstrumentationRegistry; | 10 import android.support.test.InstrumentationRegistry; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 @Before | 110 @Before |
111 public void setUp() throws InterruptedException { | 111 public void setUp() throws InterruptedException { |
112 mActivityTestRule.startMainActivityWithURL(UrlUtils.getIsolatedTestFileU
rl(TEST_URL)); | 112 mActivityTestRule.startMainActivityWithURL(UrlUtils.getIsolatedTestFileU
rl(TEST_URL)); |
113 } | 113 } |
114 | 114 |
115 @Test | 115 @Test |
116 @MediumTest | 116 @MediumTest |
117 @Feature({"VideoFullscreenOrientationLock"}) | 117 @Feature({"VideoFullscreenOrientationLock"}) |
118 @RetryOnFailure // The final waitForContentsFullscreenState(false) is flaky
- crbug.com/711005. | 118 @RetryOnFailure // The final waitForContentsFullscreenState(false) is flaky
- crbug.com/711005. |
119 public void testUnlockWithDownloadViewerActivity() throws Exception { | 119 public void testUnlockWithDownloadViewerActivity() throws Exception { |
120 if (DeviceFormFactor.isTablet(InstrumentationRegistry.getInstrumentation
().getContext())) { | 120 if (DeviceFormFactor.isTablet()) { |
121 return; | 121 return; |
122 } | 122 } |
123 | 123 |
124 // Start playback to guarantee it's properly loaded. | 124 // Start playback to guarantee it's properly loaded. |
125 Assert.assertTrue(DOMUtils.isMediaPaused(getWebContents(), VIDEO_ID)); | 125 Assert.assertTrue(DOMUtils.isMediaPaused(getWebContents(), VIDEO_ID)); |
126 DOMUtils.playMedia(getWebContents(), VIDEO_ID); | 126 DOMUtils.playMedia(getWebContents(), VIDEO_ID); |
127 DOMUtils.waitForMediaPlay(getWebContents(), VIDEO_ID); | 127 DOMUtils.waitForMediaPlay(getWebContents(), VIDEO_ID); |
128 | 128 |
129 // Trigger requestFullscreen() via a click on a button. | 129 // Trigger requestFullscreen() via a click on a button. |
130 Assert.assertTrue(DOMUtils.clickNode( | 130 Assert.assertTrue(DOMUtils.clickNode( |
(...skipping 10 matching lines...) Expand all Loading... |
141 DownloadUtils.getMediaViewerIntentForDownloadItem(fileUri, fileU
ri, mimeType); | 141 DownloadUtils.getMediaViewerIntentForDownloadItem(fileUri, fileU
ri, mimeType); |
142 IntentHandler.startActivityForTrustedIntent(intent); | 142 IntentHandler.startActivityForTrustedIntent(intent); |
143 waitUntilUnlocked(); | 143 waitUntilUnlocked(); |
144 | 144 |
145 // Sometimes the web page doesn't transition out of fullscreen until we
exit the download | 145 // Sometimes the web page doesn't transition out of fullscreen until we
exit the download |
146 // activity and return to the web page. | 146 // activity and return to the web page. |
147 InstrumentationRegistry.getInstrumentation().sendKeyDownUpSync(KeyEvent.
KEYCODE_BACK); | 147 InstrumentationRegistry.getInstrumentation().sendKeyDownUpSync(KeyEvent.
KEYCODE_BACK); |
148 waitForContentsFullscreenState(false); | 148 waitForContentsFullscreenState(false); |
149 } | 149 } |
150 } | 150 } |
OLD | NEW |