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

Unified Diff: LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html

Issue 132823005: Schedule session initialization in MediaKeys. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@rename_close_gkr
Patch Set: Created 6 years, 11 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 | LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html
diff --git a/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html b/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html
index 294bec66235ed8b8655837dac41eee9af6cd3a50..0cf111f4943c06e9f6580e014359f166eb9f07e7 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html
+++ b/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html
@@ -16,7 +16,14 @@
var mediaKeySession;
var initData = stringToUint8Array('mock');
- function runTest()
+ function checkError()
+ {
+ testExpected('mediaKeySession.error', null, '!=');
+ testExpected('mediaKeySession.error.code', MediaKeyError.MEDIA_KEYERR_UNKNOWN);
+ testExpected('mediaKeySession.error.systemCode', 0);
+ }
+
+ function runTest()
{
consoleWrite("Test MediaKeys.");
testExpected('typeof window.MediaKeys', 'function');
@@ -26,8 +33,14 @@
testExpected('typeof mediaKeys', 'object');
testExpected('mediaKeys.keySystem', 'org.w3.clearkey');
testExpected('typeof mediaKeys.createSession', 'function');
+
+ testException('mediaKeys.createSession()', '"TypeError: Failed to execute \'createSession\' on \'MediaKeys\': 2 arguments required, but only 0 present."');
+ testException('mediaKeys.createSession("")', '"TypeError: Failed to execute \'createSession\' on \'MediaKeys\': 2 arguments required, but only 1 present."');
+ testException('mediaKeys.createSession("video/webm")', '"TypeError: Failed to execute \'createSession\' on \'MediaKeys\': 2 arguments required, but only 1 present."');
testDOMException('mediaKeys.createSession("", new Uint8Array(1))', "DOMException.INVALID_ACCESS_ERR");
- testDOMException('mediaKeys.createSession("unsupported/type")', "DOMException.NOT_SUPPORTED_ERR");
+ testDOMException('mediaKeys.createSession("video/webm", null)', "DOMException.INVALID_ACCESS_ERR");
+ testDOMException('mediaKeys.createSession("video/webm", new Uint8Array(0))', "DOMException.INVALID_ACCESS_ERR");
+ testDOMException('mediaKeys.createSession("unsupported/type", new Uint8Array(1))', "DOMException.NOT_SUPPORTED_ERR");
consoleWrite("");
consoleWrite("Test MediaKeySession.");
@@ -41,7 +54,14 @@
testExpected('mediaKeySession.onwebkitkeyadded', null);
testExpected('mediaKeySession.onwebkitkeyerror', null);
testExpected('mediaKeySession.onwebkitkeymessage', null);
+ testException('mediaKeySession.update()', '"TypeError: Failed to execute \'update\' on \'MediaKeySession\': 1 argument required, but only 0 present."');
testDOMException('mediaKeySession.update(null)', "DOMException.INVALID_ACCESS_ERR");
+
+ run('mediaKeySession.update(new Uint8Array(1))');
+ waitForEvent('webkitkeyerror', checkError, true, true, mediaKeySession);
xhwang 2014/01/15 02:14:48 FYI, this works. But as you mentioned, this should
+
+ // FIXME: Test MediaKeySession.release().
+
endTest();
}
</script>
« no previous file with comments | « no previous file | LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698