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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/encrypted-media/scripts/not-callable-after-createsession.js

Issue 2546853003: Add W3C encrypted-media tests (Closed)
Patch Set: rebase now that content files landed Created 4 years 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 function runTest(config,qualifier) {
2 // After creation, the MediaKeySession object is not
3 // callable, and we should get a InvalidStateError.
4
5 promise_test(function()
6 {
7 return navigator.requestMediaKeySystemAccess(config.keysystem, getSimple Configuration()).then(function(access) {
8 return access.createMediaKeys();
9 }).then(function(mediaKeys) {
10 var mediaKeySession = mediaKeys.createSession();
11
12 var arbitraryResponse = new Uint8Array([0x00, 0x11]);
13 return mediaKeySession.update(arbitraryResponse).then(function(resul t) {
14 assert_unreached('update() succeeded unexpectedly.');
15 }).catch(function(error) {
16 assert_equals(error.name, 'InvalidStateError');
17 });
18 });
19 }, testnamePrefix( qualifier, config.keysystem ) + ', temporary, update() im mediately after createSession()');
20
21 promise_test(function()
22 {
23 return navigator.requestMediaKeySystemAccess(config.keysystem, getSimple Configuration()).then(function(access) {
24 return access.createMediaKeys();
25 }).then(function(mediaKeys) {
26 var mediaKeySession = mediaKeys.createSession();
27
28 return mediaKeySession.close().then(function(result) {
29 assert_unreached('close() succeeded unexpectedly.');
30 }).catch(function(error) {
31 assert_equals(error.name, 'InvalidStateError');
32 });
33 });
34 }, testnamePrefix( qualifier, config.keysystem ) + ', temporary, close() imm ediately after createSession()');
35
36 promise_test(function()
37 {
38 return navigator.requestMediaKeySystemAccess(config.keysystem, getSimple Configuration()).then(function(access) {
39 return access.createMediaKeys();
40 }).then(function(mediaKeys) {
41 var mediaKeySession = mediaKeys.createSession();
42
43 return mediaKeySession.remove().then(function(result) {
44 assert_unreached('remove() succeeded unexpectedly.');
45 }).catch(function(error) {
46 assert_equals(error.name, 'InvalidStateError');
47 });
48 });
49 }, testnamePrefix( qualifier, config.keysystem ) + ', temporary, remove() im mediately after createSession()');
50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698