Commit 1d0f95c1 authored by Jazz Xu's avatar Jazz Xu Committed by Commit Bot

Picture In Picture: Fix PictureInPictureController test.

ScrollNodeIntoView is causing the clickNode failure. Set
it to false to fix the issue.

Bug: 1000183
Change-Id: Ic80afd852e57a9a54e55cb1d7406bf3f0f701b0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1896344Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Jazz Xu <jazzhsu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712660}
parent afcf1570
......@@ -18,7 +18,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.MinAndroidSdkLevel;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.ChromeTabbedActivity;
......@@ -74,7 +73,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testFullscreenVideoDetected() throws Throwable {
enterFullscreen();
}
......@@ -83,7 +81,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testFullscreenVideoDetectedOnlyWhenPlaying() throws Throwable {
enterFullscreen();
......@@ -96,7 +93,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testEnterPip() throws Throwable {
enterFullscreen();
triggerAutoPiP();
......@@ -108,7 +104,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitPipOnNavigation() throws Throwable {
testExitOn(() -> JavaScriptUtils.executeJavaScript(getWebContents(),
"window.location.href = 'https://www.example.com/';"));
......@@ -118,7 +113,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitOnLeaveFullscreen() throws Throwable {
testExitOn(() -> DOMUtils.exitFullscreen(getWebContents()));
}
......@@ -127,7 +121,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitOnCloseTab() throws Throwable {
// We want 2 Tabs so we can close the first without any special behaviour.
mActivityTestRule.loadUrlInNewTab(mTestServer.getURL(TEST_PATH));
......@@ -139,7 +132,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitOnCrash() throws Throwable {
testExitOn(() -> WebContentsUtils.simulateRendererKilled(getWebContents(), false));
}
......@@ -148,7 +140,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitOnNewForegroundTab() throws Throwable {
testExitOn(new Runnable() {
@Override
......@@ -166,7 +157,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testNoExitOnIframeNavigation() throws Throwable {
// Add a TabObserver so we know when the iFrame navigation has occurred before we check that
// we are still in PiP.
......@@ -190,7 +180,6 @@ public class PictureInPictureControllerTest {
@Test
@MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testReenterPip() throws Throwable {
enterFullscreen();
triggerAutoPiP();
......@@ -225,7 +214,8 @@ public class PictureInPictureControllerTest {
DOMUtils.waitForMediaPlay(getWebContents(), VIDEO_ID);
// Trigger requestFullscreen() via a click on a button.
Assert.assertTrue(DOMUtils.clickNode(getWebContents(), "fullscreen"));
Assert.assertTrue(DOMUtils.clickNode(getWebContents(), "fullscreen",
true /* goThroughRootAndroidView */, false /* shouldScrollIntoView */));
// We use the web contents fullscreen heuristic.
CriteriaHelper.pollUiThread(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment