OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.android_webview.test; | 5 package org.chromium.android_webview.test; |
6 | 6 |
7 import android.test.suitebuilder.annotation.MediumTest; | 7 import android.test.suitebuilder.annotation.MediumTest; |
8 import android.view.View; | 8 import android.view.View; |
9 import android.view.ViewGroup; | 9 import android.view.ViewGroup; |
10 | 10 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 String testUrl = mTestContainerView.getAwContents().getUrl(); | 244 String testUrl = mTestContainerView.getAwContents().getUrl(); |
245 if (VIDEO_INSIDE_DIV_TEST_URL.equals(testUrl)) { | 245 if (VIDEO_INSIDE_DIV_TEST_URL.equals(testUrl)) { |
246 // VIDEO_INSIDE_DIV_TEST_URL uses a custom play control with known i
d. | 246 // VIDEO_INSIDE_DIV_TEST_URL uses a custom play control with known i
d. |
247 DOMUtils.clickNode(this, mContentViewCore, CUSTOM_PLAY_CONTROL_ID); | 247 DOMUtils.clickNode(this, mContentViewCore, CUSTOM_PLAY_CONTROL_ID); |
248 } else if (VIDEO_TEST_URL.equals(testUrl) | 248 } else if (VIDEO_TEST_URL.equals(testUrl) |
249 && DOMUtils.isFullscreen(mContentViewCore.getWebContents())) { | 249 && DOMUtils.isFullscreen(mContentViewCore.getWebContents())) { |
250 // VIDEO_TEST_URL uses the standard html5 video controls. The standa
rd | 250 // VIDEO_TEST_URL uses the standard html5 video controls. The standa
rd |
251 // html5 controls are shadow html elements without any ids. In fulls
creen we can still | 251 // html5 controls are shadow html elements without any ids. In fulls
creen we can still |
252 // tap the play button because this is rendered in the center of the
custom view. | 252 // tap the play button because this is rendered in the center of the
custom view. |
253 // In embedded mode we don't have an easy way of retrieving its loca
tion. | 253 // In embedded mode we don't have an easy way of retrieving its loca
tion. |
254 TouchCommon touchCommon = new TouchCommon(AwContentsClientFullScreen
Test.this); | 254 TouchCommon.singleClickView(mContentsClient.getCustomView()); |
255 touchCommon.singleClickView(mContentsClient.getCustomView()); | |
256 } else { | 255 } else { |
257 fail("Unable to tap standard html5 play control in embedded mode"); | 256 fail("Unable to tap standard html5 play control in embedded mode"); |
258 } | 257 } |
259 } | 258 } |
260 | 259 |
261 /** | 260 /** |
262 * Asserts that the keep screen on property in the given {@code view} is act
ive as | 261 * Asserts that the keep screen on property in the given {@code view} is act
ive as |
263 * {@code expected}. It also verifies that it is only active when the video
is playing. | 262 * {@code expected}. It also verifies that it is only active when the video
is playing. |
264 */ | 263 */ |
265 private void assertKeepScreenOnActive(final View view, final boolean expecte
d) | 264 private void assertKeepScreenOnActive(final View view, final boolean expecte
d) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 private void loadTestPageAndClickFullscreen(String videoTestUrl) throws Exce
ption { | 321 private void loadTestPageAndClickFullscreen(String videoTestUrl) throws Exce
ption { |
323 loadTestPage(videoTestUrl); | 322 loadTestPage(videoTestUrl); |
324 DOMUtils.clickNode(this, mContentViewCore, CUSTOM_FULLSCREEN_CONTROL_ID)
; | 323 DOMUtils.clickNode(this, mContentViewCore, CUSTOM_FULLSCREEN_CONTROL_ID)
; |
325 } | 324 } |
326 | 325 |
327 private void loadTestPage(String videoTestUrl) throws Exception { | 326 private void loadTestPage(String videoTestUrl) throws Exception { |
328 loadUrlSync(mTestContainerView.getAwContents(), | 327 loadUrlSync(mTestContainerView.getAwContents(), |
329 mContentsClient.getOnPageFinishedHelper(), videoTestUrl); | 328 mContentsClient.getOnPageFinishedHelper(), videoTestUrl); |
330 } | 329 } |
331 } | 330 } |
OLD | NEW |