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

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

Issue 2678433003: media: Require SecureContext for EME APIs (Closed)
Patch Set: rebase only Created 3 years, 10 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 | « no previous file | android_webview/test/BUILD.gn » ('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/KeySystemTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java
index 3bda0041ee011f3b717ff0e58a2eaf7e75a38722..d00a3da9fae3c6ecbb7652af70022ed6a877eb73 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java
@@ -50,36 +50,8 @@ public class KeySystemTest extends AwTestBase {
mAwContents = testContainerView.getAwContents();
enableJavaScriptOnUiThread(mAwContents);
- loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
- getKeySystemTestPage(), "text/html", false);
- }
-
- private String getKeySystemTestPage() {
- // requestMediaKeySystemAccess() provides 2 different configurations
- // as encrypted webm is only supported on Lollipop+. mp4 is proprietary,
- // and may not be supported on all Android devices.
- return "<html> <script>"
- + "var result;"
- + "function success(keySystemAccess) {"
- + " result = 'supported';"
- + "}"
- + "function failure(error){"
- + " result = error.name;"
- + "}"
- + "function isKeySystemSupported(keySystem) {"
- + " navigator.requestMediaKeySystemAccess("
- + " keySystem, "
- + " [{audioCapabilities:"
- + " [{contentType: 'audio/webm; codec=\"vorbis\"'}]}, "
- + " {videoCapabilities:"
- + " [{contentType: 'video/mp4; codecs=\"avc1.4D000C\"'}]}])"
- + " .then(success, failure);"
- + "}"
- + "function areProprietaryCodecsSupported() {"
- + " var video = document.createElement('video');"
- + " return video.canPlayType('video/mp4; codecs=\"avc1\"');"
- + "}"
- + "</script> </html>";
+ loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
+ "file:///android_asset/key-system-test.html");
}
private String isKeySystemSupported(String keySystem) throws Exception {
« no previous file with comments | « no previous file | android_webview/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698