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

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

Issue 946503002: Filter supported session types in createSession(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@export
Patch Set: Remove persistent-license syntax tests. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/modules/encryptedmedia/MediaKeySystemAccess.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/encrypted-media/encrypted-media-syntax.html
diff --git a/LayoutTests/media/encrypted-media/encrypted-media-syntax.html b/LayoutTests/media/encrypted-media/encrypted-media-syntax.html
index aa38eb6e7c9ba37d73e1303e901ea3b119ed7723..e99ff8ac2183e13fa41c6e75b79ffe88166835a6 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-syntax.html
+++ b/LayoutTests/media/encrypted-media/encrypted-media-syntax.html
@@ -376,17 +376,12 @@
});
}, 'Test MediaKeys generateRequest() exceptions.');
- // FIXME: Add tests for 'persistent-release-message' once supported.
var kLoadExceptionsTestCases = [
// Too few parameters.
{
exception: 'TypeError',
func: function(mk1) { return mk1.createSession('temporary').load(); }
},
- {
- exception: 'TypeError',
- func: function(mk2) { return mk2.createSession('persistent-license').load(); }
- },
// 'temporary' sessions are never allowed, so always return
// 'InvalidAccessError'.
{
@@ -404,41 +399,6 @@
{
exception: 'InvalidAccessError',
func: function(mk6) { return mk6.createSession('temporary').load('1234'); }
- },
- // Invalid parameters.
- // For 'persistent' sessions, JS calls .toString() on the
- // parameter if it is not already a string before passing it
- // to code. So tests like mk8 or mk9 pass in "null" or
- // "undefined" as the sessionId.
- {
- exception: 'InvalidAccessError',
- func: function(mk7) { return mk7.createSession('persistent-license').load(''); }
- },
- {
- exception: 'NotSupportedError',
- func: function(mk8) { return mk8.createSession('persistent-license').load(null); }
- },
- {
- exception: 'NotSupportedError',
- func: function(mk9) { return mk9.createSession('persistent-license').load(undefined); }
- },
- {
- exception: 'NotSupportedError',
- func: function(mk10) { return mk10.createSession('persistent-license').load(1); }
- },
- {
- exception: 'InvalidAccessError',
- func: function(mk11) { return mk11.createSession('persistent-license').load(new Uint8Array(0)); }
- },
- // Invalid session id.
- {
- exception: 'InvalidAccessError',
- func: function(mk12) { return mk12.createSession('persistent-license').load('!@#$%^&*()'); }
- },
- // Valid session id (but not supported by Clear Key).
- {
- exception: 'NotSupportedError',
- func: function(mk13) { return mk13.createSession('persistent-license').load('1234'); }
}
];
@@ -784,7 +744,7 @@
var mediaKeySession = mediaKeys.createSession('temporary');
return mediaKeySession.remove().then(function(result) {
assert_unreached('remove() should not succeed if session uninitialized');
- }).catch(function(error) {
+ }, function(error) {
assert_equals(error.name, 'InvalidStateError');
// remove() on a temporary session should fail.
@@ -793,25 +753,8 @@
return mediaKeySession.remove();
}).then(function(result) {
assert_unreached('remove() should not succeed for temporary sessions');
- }).catch(function(error) {
+ }, function(error) {
assert_equals(error.name, 'InvalidAccessError');
ddorwin 2015/02/20 22:26:57 We should at least have tests that we get NotSuppo
-
- // remove() on a closed persistent-license session should also fail.
- mediaKeySession = mediaKeys.createSession('persistent-license');
- return mediaKeySession.generateRequest(type, initData);
- }).then(function(result) {
- return mediaKeySession.close();
- }).then(function(result) {
- return mediaKeySession.remove();
- }).then(function(result) {
- assert_unreached('remove() should not succeed for closed persistent-license sessions');
- }).catch(function(error) {
- assert_equals(error.name, 'InvalidStateError');
-
- // Add test for persistent-release-message once supported.
-
- // Return something so the promise resolves.
- return Promise.resolve();
});
}
« no previous file with comments | « no previous file | Source/modules/encryptedmedia/MediaKeySystemAccess.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698