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

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

Issue 1824143004: Allow WebView to force MediaPlayer for unsupported containers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't concat strings. Created 4 years, 9 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 | « android_webview/android_webview_tests.gypi ('k') | android_webview/renderer/aw_content_renderer_client.h » ('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/PlatformMediaCodecTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/PlatformMediaCodecTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/PlatformMediaCodecTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..42942e846fe46b7ef0cf7102239d7985c2a41f7c
--- /dev/null
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/PlatformMediaCodecTest.java
@@ -0,0 +1,55 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.android_webview.test;
+
+import android.test.suitebuilder.annotation.MediumTest;
+
+import org.chromium.base.test.util.Feature;
+import org.chromium.content.browser.ContentViewCore;
+import org.chromium.content.browser.test.util.DOMUtils;
+import org.chromium.content_public.browser.WebContents;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Test that a page with a non-Chrome media codec can playback correctly; this
+ * test is *NOT* exhaustive, but merely spot checks a single instance.
+ */
+public class PlatformMediaCodecTest extends AwTestBase {
+ private TestAwContentsClient mContentsClient;
+ private AwTestContainerView mTestContainerView;
+ private ContentViewCore mContentViewCore;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ mContentsClient = new TestAwContentsClient();
+ mTestContainerView = createAwTestContainerViewOnMainSync(mContentsClient);
+ mContentViewCore = mTestContainerView.getContentViewCore();
+ enableJavaScriptOnUiThread(mTestContainerView.getAwContents());
+ }
+
+ @MediumTest
+ @Feature({"AndroidWebView"})
+ public void testCanPlayPlatformMediaCodecs() throws Throwable {
+ loadUrlSync(mTestContainerView.getAwContents(), mContentsClient.getOnPageFinishedHelper(),
+ "file:///android_asset/platform-media-codec-test.html");
+ DOMUtils.clickNode(this, mContentViewCore, "playButton");
+ DOMUtils.waitForMediaPlay(getWebContentsOnUiThread(), "videoTag");
+ }
+
+ private WebContents getWebContentsOnUiThread() {
+ try {
+ return runTestOnUiThreadAndGetResult(new Callable<WebContents>() {
+ @Override
+ public WebContents call() throws Exception {
+ return mContentViewCore.getWebContents();
+ }
+ });
+ } catch (Exception e) {
+ fail(e.getMessage());
+ return null;
+ }
+ }
+}
« no previous file with comments | « android_webview/android_webview_tests.gypi ('k') | android_webview/renderer/aw_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698