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; ...@@ -18,7 +18,6 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.MinAndroidSdkLevel; import org.chromium.base.test.util.MinAndroidSdkLevel;
import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.ChromeTabbedActivity;
...@@ -74,7 +73,6 @@ public class PictureInPictureControllerTest { ...@@ -74,7 +73,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testFullscreenVideoDetected() throws Throwable { public void testFullscreenVideoDetected() throws Throwable {
enterFullscreen(); enterFullscreen();
} }
...@@ -83,7 +81,6 @@ public class PictureInPictureControllerTest { ...@@ -83,7 +81,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testFullscreenVideoDetectedOnlyWhenPlaying() throws Throwable { public void testFullscreenVideoDetectedOnlyWhenPlaying() throws Throwable {
enterFullscreen(); enterFullscreen();
...@@ -96,7 +93,6 @@ public class PictureInPictureControllerTest { ...@@ -96,7 +93,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testEnterPip() throws Throwable { public void testEnterPip() throws Throwable {
enterFullscreen(); enterFullscreen();
triggerAutoPiP(); triggerAutoPiP();
...@@ -108,7 +104,6 @@ public class PictureInPictureControllerTest { ...@@ -108,7 +104,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitPipOnNavigation() throws Throwable { public void testExitPipOnNavigation() throws Throwable {
testExitOn(() -> JavaScriptUtils.executeJavaScript(getWebContents(), testExitOn(() -> JavaScriptUtils.executeJavaScript(getWebContents(),
"window.location.href = 'https://www.example.com/';")); "window.location.href = 'https://www.example.com/';"));
...@@ -118,7 +113,6 @@ public class PictureInPictureControllerTest { ...@@ -118,7 +113,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitOnLeaveFullscreen() throws Throwable { public void testExitOnLeaveFullscreen() throws Throwable {
testExitOn(() -> DOMUtils.exitFullscreen(getWebContents())); testExitOn(() -> DOMUtils.exitFullscreen(getWebContents()));
} }
...@@ -127,7 +121,6 @@ public class PictureInPictureControllerTest { ...@@ -127,7 +121,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitOnCloseTab() throws Throwable { public void testExitOnCloseTab() throws Throwable {
// We want 2 Tabs so we can close the first without any special behaviour. // We want 2 Tabs so we can close the first without any special behaviour.
mActivityTestRule.loadUrlInNewTab(mTestServer.getURL(TEST_PATH)); mActivityTestRule.loadUrlInNewTab(mTestServer.getURL(TEST_PATH));
...@@ -139,7 +132,6 @@ public class PictureInPictureControllerTest { ...@@ -139,7 +132,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitOnCrash() throws Throwable { public void testExitOnCrash() throws Throwable {
testExitOn(() -> WebContentsUtils.simulateRendererKilled(getWebContents(), false)); testExitOn(() -> WebContentsUtils.simulateRendererKilled(getWebContents(), false));
} }
...@@ -148,7 +140,6 @@ public class PictureInPictureControllerTest { ...@@ -148,7 +140,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testExitOnNewForegroundTab() throws Throwable { public void testExitOnNewForegroundTab() throws Throwable {
testExitOn(new Runnable() { testExitOn(new Runnable() {
@Override @Override
...@@ -166,7 +157,6 @@ public class PictureInPictureControllerTest { ...@@ -166,7 +157,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testNoExitOnIframeNavigation() throws Throwable { public void testNoExitOnIframeNavigation() throws Throwable {
// Add a TabObserver so we know when the iFrame navigation has occurred before we check that // Add a TabObserver so we know when the iFrame navigation has occurred before we check that
// we are still in PiP. // we are still in PiP.
...@@ -190,7 +180,6 @@ public class PictureInPictureControllerTest { ...@@ -190,7 +180,6 @@ public class PictureInPictureControllerTest {
@Test @Test
@MediumTest @MediumTest
@MinAndroidSdkLevel(Build.VERSION_CODES.O) @MinAndroidSdkLevel(Build.VERSION_CODES.O)
@DisabledTest(message = "https://crbug.com/1000183")
public void testReenterPip() throws Throwable { public void testReenterPip() throws Throwable {
enterFullscreen(); enterFullscreen();
triggerAutoPiP(); triggerAutoPiP();
...@@ -225,7 +214,8 @@ public class PictureInPictureControllerTest { ...@@ -225,7 +214,8 @@ public class PictureInPictureControllerTest {
DOMUtils.waitForMediaPlay(getWebContents(), VIDEO_ID); DOMUtils.waitForMediaPlay(getWebContents(), VIDEO_ID);
// Trigger requestFullscreen() via a click on a button. // 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. // We use the web contents fullscreen heuristic.
CriteriaHelper.pollUiThread( 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