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

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

Issue 563083002: Implement MediaKeys.setServerCertificate() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 2 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 | Source/modules/encryptedmedia/MediaKeys.h » ('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 bfd68685e6bd458883505cd0d270946d5406c2da..3c3ac07737f338cd0f64904efb48d8b6dba9baa9 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html
+++ b/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html
@@ -589,6 +589,65 @@
});
}, 'Test MediaKeySession release().');
+ var kSetServerCertificateExceptionsTestCases = [
+ // Too few parameters.
+ {
+ exception: 'TypeError',
+ func: function(mk) { return mk.setServerCertificate(); }
+ },
+ // Invalid parameters.
+ {
+ exception: 'TypeError',
+ func: function(mk) { return mk.setServerCertificate(''); }
+ },
+ {
+ exception: 'TypeError',
+ func: function(mk) { return mk.setServerCertificate(null); }
+ },
+ {
+ exception: 'TypeError',
+ func: function(mk) { return mk.setServerCertificate(undefined); }
+ },
+ {
+ exception: 'TypeError',
+ func: function(mk) { return mk.setServerCertificate(1); }
+ },
+ // Empty array.
+ {
+ exception: 'InvalidAccessError',
+ func: function(mk) { return mk.setServerCertificate(new Uint8Array(0)); }
+ },
+ // Valid calls, but not supported by ClearKey.
+ {
+ exception: 'NotSupportedError',
+ func: function(mk) { var cert = new Uint8Array(200); assert_true(ArrayBuffer.isView(cert)); return mk.setServerCertificate(cert); }
+ },
+ {
+ // Pass in ArrayBuffer
+ exception: 'NotSupportedError',
+ func: function(mk) { var cert = new Uint8Array(200); assert_false(ArrayBuffer.isView(cert.buffer)); return mk.setServerCertificate(cert.buffer); }
+ }
+ ];
+
+ async_test(function(test)
+ {
+ MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
+ var promises = kSetServerCertificateExceptionsTestCases.map(function(testCase) {
+ return test_exception(testCase, mediaKeys);
+ });
+
+ assert_not_equals(promises.length, 0);
+ return Promise.all(promises);
+ }).then(function(result) {
+ test.done();
+ }).catch(function(error) {
+ forceTestFailureFromPromise(test, error, 'setServerCertificate() exception tests failed');
+ });
+ }, 'Test MediaKeys setServerCertificate() exceptions.');
+
+ // FIXME: Add test for successful setServerCertificate(). Note that
+ // ClearKey does not support it.
+
// FIXME: Add syntax checks for MediaKeys.IsTypeSupported().
// FIXME: Add syntax checks for MediaKeyError and MediaKeySession events.
// FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, mediakeys, onencrypted.
« no previous file with comments | « no previous file | Source/modules/encryptedmedia/MediaKeys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698