| Index: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenVideoTest.java
|
| diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenVideoTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenVideoTest.java
|
| index cd25445508c289b25259a3fe2b7b4c07b53389d1..897e7105d53360520dc5414fee08db00994ad88e 100644
|
| --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenVideoTest.java
|
| +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenVideoTest.java
|
| @@ -10,6 +10,7 @@ import android.view.View;
|
|
|
| import junit.framework.Assert;
|
|
|
| +import org.chromium.android_webview.test.util.JavascriptEventObserver;
|
| import org.chromium.android_webview.test.util.VideoTestWebServer;
|
| import org.chromium.base.CommandLine;
|
| import org.chromium.base.test.util.Feature;
|
| @@ -35,6 +36,7 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase {
|
| createAwTestContainerViewOnMainSync(mContentsClient);
|
| mContentViewCore = mTestContainerView.getContentViewCore();
|
| enableJavaScriptOnUiThread(mTestContainerView.getAwContents());
|
| + mTestContainerView.getAwContents().getSettings().setFullscreenSupported(true);
|
| mWebServer = new VideoTestWebServer(
|
| getInstrumentation().getTargetContext());
|
| }
|
| @@ -109,6 +111,25 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase {
|
| mContentViewCore, VideoTestWebServer.VIDEO_ID));
|
| }
|
|
|
| + @MediumTest
|
| + @Feature({"AndroidWebView"})
|
| + public void testFullscreenNotSupported() throws Throwable {
|
| + mTestContainerView.getAwContents().getSettings().setFullscreenSupported(false);
|
| +
|
| + final JavascriptEventObserver fullScreenErrorObserver = new JavascriptEventObserver();
|
| + getInstrumentation().runOnMainSync(new Runnable() {
|
| + @Override
|
| + public void run() {
|
| + fullScreenErrorObserver.register(mContentViewCore, "javaFullScreenErrorObserver");
|
| + }
|
| + });
|
| +
|
| + loadTestPageAndClickFullscreen();
|
| +
|
| + Assert.assertTrue(fullScreenErrorObserver.waitForEvent(500));
|
| + Assert.assertFalse(mContentsClient.wasCustomViewShownCalled());
|
| + }
|
| +
|
| private static boolean areHtmlControlsEnabled() {
|
| return !CommandLine.getInstance().hasSwitch(
|
| ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE);
|
| @@ -122,6 +143,11 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase {
|
| }
|
|
|
| private void doOnShowCustomViewTest() throws Exception {
|
| + loadTestPageAndClickFullscreen();
|
| + mContentsClient.waitForCustomViewShown();
|
| + }
|
| +
|
| + private void loadTestPageAndClickFullscreen() throws Exception {
|
| loadUrlSync(mTestContainerView.getAwContents(),
|
| mContentsClient.getOnPageFinishedHelper(),
|
| mWebServer.getFullScreenVideoTestURL());
|
| @@ -129,6 +155,5 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase {
|
| // Click the button in full_screen_video_test.html to enter fullscreen.
|
| TouchCommon touchCommon = new TouchCommon(this);
|
| touchCommon.singleClickView(mTestContainerView);
|
| - mContentsClient.waitForCustomViewShown();
|
| }
|
| }
|
|
|