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

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

Issue 425343002: [Android WebView] API to enable fullscreen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update AwContentsClientGetVideoLoadingProgressViewTest Created 6 years, 4 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
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();
}
}

Powered by Google App Engine
This is Rietveld 408576698