Bug 1252168 - Don't send CDM unsupported notifications from Gecko to chrome. r?kentuckyfriedtakahe draft
authorChris Pearce <cpearce@mozilla.com>
Thu, 03 Mar 2016 11:02:17 +1300
changeset 336377 d6c982795c277770ed0b1299fddedbfcf2333600
parent 336168 c59c022943f6a7e79f6002e11fc9f56cb836f5dd
child 515376 5319f3b667c86f0c3dbf77b54805b841fb1f7d65
push id12044
push usercpearce@mozilla.com
push dateThu, 03 Mar 2016 02:25:27 +0000
reviewerskentuckyfriedtakahe
bugs1252168
milestone47.0a1
Bug 1252168 - Don't send CDM unsupported notifications from Gecko to chrome. r?kentuckyfriedtakahe MozReview-Commit-ID: FDfpeEt3HfT
dom/media/eme/MediaKeySystemAccess.cpp
dom/media/test/test_eme_request_notifications.html
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -572,16 +572,22 @@ MediaKeySystemAccess::GetSupportedConfig
 
 
 /* static */
 void
 MediaKeySystemAccess::NotifyObservers(nsPIDOMWindowInner* aWindow,
                                       const nsAString& aKeySystem,
                                       MediaKeySystemStatus aStatus)
 {
+  if (aStatus == MediaKeySystemStatus::Cdm_not_supported) {
+    // Ignore, since there's nothing the user can do to rectify this, and we
+    // don't want the prompt to confuse them.
+    // TODO: Remove places that call with this entirely.
+    return;
+  }
   RequestMediaKeySystemAccessNotification data;
   data.mKeySystem = aKeySystem;
   data.mStatus = aStatus;
   nsAutoString json;
   data.ToJSON(json);
   EME_LOG("MediaKeySystemAccess::NotifyObservers() %s", NS_ConvertUTF16toUTF8(json).get());
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   if (obs) {
--- a/dom/media/test/test_eme_request_notifications.html
+++ b/dom/media/test/test_eme_request_notifications.html
@@ -70,21 +70,16 @@ var tests = [
   },
   {
     keySystem: CLEARKEY_ID,
     shouldPass: false,
     expectedStatus: 'cdm-disabled',
     prefs: [["media.eme.enabled", true], ["media.eme.clearkey.enabled", false]]
   },
   {
-    keySystem: 'unsupported-keysystem',
-    shouldPass: false,
-    expectedStatus: 'cdm-not-supported'
-  },
-  {
     keySystem: CLEARKEY_ID + '.10000' , // A stupendously high min CDM version, presumably not installed.
     shouldPass: false,
     expectedStatus: 'cdm-insufficient-version',
     prefs: [["media.eme.enabled", true], ["media.eme.clearkey.enabled", true]]
   },
   {
     keySystem: CLEARKEY_ID,
     shouldPass: true,