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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java

Issue 2638973004: Use ContainerView for PowerSaveBlocker to keep screen on (Closed)
Patch Set: fix tests/2 Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | device/power_save_blocker/android/java/src/org/chromium/device/power_save_blocker/PowerSaveBlocker.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java
index c54ca5d24a11def2447192783213f23ef8398328..7ea0f81d51c682a3a31196391b0c1c6ac4ca2246 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java
@@ -309,12 +309,11 @@ public class AwContentsClientFullScreenTest extends AwTestBase {
// still there.
DOMUtils.clickNode(this, mContentViewCore, CUSTOM_FULLSCREEN_CONTROL_ID);
mContentsClient.waitForCustomViewShown();
- View customView = mContentsClient.getCustomView();
- assertKeepScreenOnActive(customView, true);
+ assertKeepScreenOnActive(mTestContainerView, true);
// Pause the video and the power save blocker is gone.
DOMUtils.pauseMedia(getWebContentsOnUiThread(), VIDEO_ID);
- assertWaitForKeepScreenOnActive(customView, false);
+ assertWaitForKeepScreenOnActive(mTestContainerView, false);
// Exit fullscreen and the power save blocker is still gone.
DOMUtils.exitFullscreen(getWebContentsOnUiThread());
@@ -340,7 +339,7 @@ public class AwContentsClientFullScreenTest extends AwTestBase {
// still there.
DOMUtils.exitFullscreen(getWebContentsOnUiThread());
mContentsClient.waitForCustomViewHidden();
- assertKeepScreenOnActive(mTestContainerView, true);
+ assertKeepScreenOnActive(customView, true);
}
private void tapPlayButton() throws Exception {
@@ -402,8 +401,8 @@ public class AwContentsClientFullScreenTest extends AwTestBase {
}
private boolean getKeepScreenOnOnUiThread(View view) {
- // The power save blocker is added to a child anchor view,
- // so we need to traverse the hierarchy.
+ // The power save blocker is added to the container view.
+ // Search the view hierarchy for it.
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
« no previous file with comments | « no previous file | device/power_save_blocker/android/java/src/org/chromium/device/power_save_blocker/PowerSaveBlocker.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698