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

Unified Diff: android_webview/tools/system_webview_shell/test/data/blink-apis/eme/eme.html

Issue 1865383002: Add EME permission test to WebViewLayoutTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/tools/system_webview_shell/test/data/blink-apis/eme/eme.html
diff --git a/android_webview/tools/system_webview_shell/test/data/blink-apis/eme/eme.html b/android_webview/tools/system_webview_shell/test/data/blink-apis/eme/eme.html
new file mode 100644
index 0000000000000000000000000000000000000000..dfa97f37a7b5aee7d39d5ace04bc982462a5050e
--- /dev/null
+++ b/android_webview/tools/system_webview_shell/test/data/blink-apis/eme/eme.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+ <script src="../../resources/js-test.js"></script>
+ <body>
+ <script type="text/javascript">
+ description("Test EME permission callbacks in WebView");
timvolodine 2016/04/13 14:51:24 permission callback testing is probably not the ma
Yoland Yan(Google) 2016/04/26 02:03:57 Done.
+ window.jsTestIsAsync = true;
+
+ // https://w3c.github.io/encrypted-media/#requestMediaKeySystemAccess
+ // Tries multiple configuration per key system. The configurations are in
+ // descending order of privileges such that a supported permission-requiring
+ // configuration should be attempted before a configuration that does not
+ // require permissions.
timvolodine 2016/04/13 14:51:24 please update the comment as it does not apply
Yoland Yan(Google) 2016/04/26 02:03:58 Done.
+
+ // TODO(yolandyan) Look into whehther more key system need to be added
+ var chromeKeySystem = "com.widevine.alpha"
+
+ var tryKeySystem = function(keySystem) {
+ console.log("keySystem is " + keySystem);
timvolodine 2016/04/13 14:51:24 debug instead console.log
Yoland Yan(Google) 2016/04/26 02:03:58 Done.
+ navigator.requestMediaKeySystemAccess(
+ keySystem,
+ [
+ { distinctiveIdentifier: "required",
+ persistentState: "required",
+ label: "'distinctiveIdentifier' and 'persistentState' required"
+ },
+ { distinctiveIdentifier: "required",
+ label: "'distinctiveIdentifier' required"
+ },
+ { persistentState: "required",
+ label: "'persistentState' required"
+ },
+ { label: "empty" }
+ ]
+ ).then(
+ function (mediaKeySystemAccess) {
+ console.log("eme success");
timvolodine 2016/04/13 14:51:24 -> debug(..)
timvolodine 2016/04/13 14:51:24 nit: eme -> EME
Yoland Yan(Google) 2016/04/26 02:03:57 Done.
Yoland Yan(Google) 2016/04/26 02:03:58 Done.
+ finishJSTest();
+ },
+ function (error) {
+ debug("onError: code" + error.code + ", message=" + error.message);
+ finishJSTest();
+ }
+ );
+ };
+
+ tryKeySystem(chromeKeySystem);
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698