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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/prefixed/encrypted-media-syntax.html

Issue 1712903002: Remove prefixed EME. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix isRenewalMessage() in browser tests. Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html lang="en">
3 <head>
4 </head>
5 <body>
6 <video></video>
7 <p>Tests invalid and valid syntaxes.</p>
8
9 <script src=../../media-file.js></script>
10 <script src=../../video-test.js></script>
11 <script>
12 var initData = new Uint8Array([0x51, 0x52, 0x53]);
13 var key = initData;
14
15 function loadStarted()
16 {
17 consoleWrite("Verify valid syntaxes do not throw.");
18 testExpected("video.networkState", video.NETWORK_LOADING);
19 testExpected("video.currentSrc", "", "!=");
20 run("video.webkitGenerateKeyRequest('webkit-org.w3.clearkey')");
21 run("video.webkitGenerateKeyRequest('webkit-org.w3.clearkey', in itData)");
22 run("video.webkitAddKey('webkit-org.w3.clearkey', key)");
23 run("video.webkitAddKey('webkit-org.w3.clearkey', key, 'session' )");
24 run("video.webkitAddKey('webkit-org.w3.clearkey', key, initData) ");
25 run("video.webkitAddKey('webkit-org.w3.clearkey', key, initData, 'session')");
26 run("video.webkitCancelKeyRequest('webkit-org.w3.clearkey')");
27 run("video.webkitCancelKeyRequest('webkit-org.w3.clearkey', 'ses sion')");
28
29 consoleWrite("<br>Unsupported key systems result in NOT_SUPPORTE D_ERR.");
30 testDOMException("video.webkitGenerateKeyRequest('com.example.in valid')", "DOMException.NOT_SUPPORTED_ERR");
31 testDOMException("video.webkitAddKey('com.example.invalid', key) ", "DOMException.NOT_SUPPORTED_ERR");
32 testDOMException("video.webkitCancelKeyRequest('com.example.inva lid')", "DOMException.NOT_SUPPORTED_ERR");
33
34 endTest();
35 }
36
37 consoleWrite("Test calling functions with too few parameters.");
38 testException("video.webkitGenerateKeyRequest()", '"TypeError: Faile d to execute \'webkitGenerateKeyRequest\' on \'HTMLMediaElement\': 1 argument re quired, but only 0 present."');
39 testException("video.webkitAddKey()", '"TypeError: Failed to execute \'webkitAddKey\' on \'HTMLMediaElement\': 2 arguments required, but only 0 pres ent."');
40 testException("video.webkitAddKey('webkit-org.w3.clearkey')", '"Type Error: Failed to execute \'webkitAddKey\' on \'HTMLMediaElement\': 2 arguments r equired, but only 1 present."');
41 testException("video.webkitCancelKeyRequest()", '"TypeError: Failed to execute \'webkitCancelKeyRequest\' on \'HTMLMediaElement\': 1 argument requir ed, but only 0 present."');
42
43 consoleWrite("<br>Verify invalid key system parameter is caught befo re checking whether loading has started.");
44 // If the above was not the case, all of these would be INVALID_STAT E_ERR.
45 // Also tests "null" case for first parameter.
46 testExpected("video.networkState", video.NETWORK_EMPTY);
47 testExpected("video.currentSrc", "");
48 testDOMException("video.webkitGenerateKeyRequest('')", "DOMException .SYNTAX_ERR");
49 testDOMException("video.webkitGenerateKeyRequest(null)", "DOMExcepti on.SYNTAX_ERR");
50 testDOMException("video.webkitGenerateKeyRequest(undefined)", "DOMEx ception.SYNTAX_ERR");
51 testDOMException("video.webkitAddKey('', key)", "DOMException.SYNTAX _ERR");
52 testDOMException("video.webkitAddKey(null, key)", "DOMException.SYNT AX_ERR");
53 testDOMException("video.webkitAddKey(undefined, key)", "DOMException .SYNTAX_ERR");
54 testDOMException("video.webkitCancelKeyRequest('')", "DOMException.S YNTAX_ERR");
55 testDOMException("video.webkitCancelKeyRequest(null)", "DOMException .SYNTAX_ERR");
56 testDOMException("video.webkitCancelKeyRequest(undefined)", "DOMExce ption.SYNTAX_ERR");
57
58 consoleWrite("<br>null key is caught before load state is checked.") ;
59 testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', '')", "DOMException.SYNTAX_ERR");
60 testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', null) ", "DOMException.SYNTAX_ERR");
61 testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', undef ined)", "DOMException.SYNTAX_ERR");
62
63 consoleWrite("<br>0-length key is caught before load state is checke d.");
64 testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', new U int8Array())", "DOMException.TYPE_MISMATCH_ERR");
65
66 consoleWrite("<br>Key system validity is not checked before loading. ");
67 testDOMException("video.webkitGenerateKeyRequest('com.example.invali d')", "DOMException.INVALID_STATE_ERR");
68 testDOMException("video.webkitAddKey('com.example.invalid', key)", " DOMException.INVALID_STATE_ERR");
69 testDOMException("video.webkitCancelKeyRequest('com.example.invalid' )", "DOMException.INVALID_STATE_ERR");
70
71 // FIXME(82952): Add "test-encrypted" file.
72 video.setAttribute("src", findMediaFile("video", "../../content/test "));
73 consoleWrite("");
74 waitForEvent('loadstart', loadStarted);
75 </script>
76 </body>
77 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698