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

Side by Side 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: Refactor changes 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <script src="../../resources/js-test.js"></script>
4 <body>
5 <script type="text/javascript">
6 description("Test EME permission callbacks in WebView");
7 function eme() {
8 // https://w3c.github.io/encrypted-media/#requestMediaKeySystemAccess
9 // Tries multiple configuration per key system. The configurations are i n
10 // descending order of privileges such that a supported permission-requi ring
11 // configuration should be attempted before a configuration that does no t
12 // require permissions.
13
14 var knownKeySystems = [
15 "com.example.somesystem", // Ensure no real system is the first tried .
16 "com.widevine.alpha",
17 "com.microsoft.playready",
18 "com.adobe.primetime",
19 "com.apple.fps.2_0",
20 "com.apple.fps",
21 "com.apple.fps.1_0",
22 "com.example.somesystem" // Ensure no real system is the last tried.
23 ];
24 var tryKeySystem = function(keySystem) {
25 navigator.requestMediaKeySystemAccess(
26 keySystem,
27 [
28 { distinctiveIdentifier: "required",
29 persistentState: "required",
30 label: "'distinctiveIdentifier' and 'persistentState' required"
31 },
32 { distinctiveIdentifier: "required",
33 label: "'distinctiveIdentifier' required"
34 },
35 { persistentState: "required",
36 label: "'persistentState' required"
37 },
38 { label: "empty" }
39 ]
40 ).then(
41 function (mediaKeySystemAccess) {
42 debug("eme success");
43 finishJSTest();
44 },
45 function (error) {
46 if (knownKeySystems.length > 0)
47 return tryKeySystem(knownKeySystems.shift());
48 testFailed("onError: code" + error.code + ", message=" + error.mes sage);
49 finishJSTest();
50 }
51 );
52 };
53 tryKeySystem(knownKeySystems.shift());
54 }
55 eme();
56 </script>
57 </body>
58 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698