Bug 1309299 - make navigator.requestMediaKeySystemAccess() reject with TypeError for empty keysystem string or config. r?gerald draft
authorChris Pearce <cpearce@mozilla.com>
Tue, 11 Oct 2016 10:37:34 -0700
changeset 423858 d6ed97fa53531f8a5e394fab291f93922ead1fc5
parent 423857 1c7895ea8ccdc7f75f0bd0e005d76e6991f110f1
child 533542 80e7d523e4fbcbe861e748ff9541a32ff01ef846
push id32009
push userbmo:cpearce@mozilla.com
push dateTue, 11 Oct 2016 20:01:24 +0000
reviewersgerald
bugs1309299
milestone52.0a1
Bug 1309299 - make navigator.requestMediaKeySystemAccess() reject with TypeError for empty keysystem string or config. r?gerald This makes us match the spec and pass more cases of http://www.w3c-test.org/encrypted-media/drm-mp4-syntax-mediakeysystemaccess.html but we still need to adjust the test so that it's consistent, as pointed out by bz. MozReview-Commit-ID: KEfRk4QnJKR
dom/media/eme/MediaKeySystemAccessManager.cpp
--- a/dom/media/eme/MediaKeySystemAccessManager.cpp
+++ b/dom/media/eme/MediaKeySystemAccessManager.cpp
@@ -60,21 +60,16 @@ MediaKeySystemAccessManager::~MediaKeySy
   Shutdown();
 }
 
 void
 MediaKeySystemAccessManager::Request(DetailedPromise* aPromise,
                                      const nsAString& aKeySystem,
                                      const Sequence<MediaKeySystemConfiguration>& aConfigs)
 {
-  if (aKeySystem.IsEmpty() || aConfigs.IsEmpty()) {
-    aPromise->MaybeReject(NS_ERROR_DOM_INVALID_ACCESS_ERR,
-                          NS_LITERAL_CSTRING("Invalid keysystem type or invalid options sequence"));
-    return;
-  }
   Request(aPromise, aKeySystem, aConfigs, RequestType::Initial);
 }
 
 void
 MediaKeySystemAccessManager::Request(DetailedPromise* aPromise,
                                      const nsAString& aKeySystem,
                                      const Sequence<MediaKeySystemConfiguration>& aConfigs,
                                      RequestType aType)