Bug 1252168 - Don't send CDM unsupported notifications from Gecko to chrome. r?kentuckyfriedtakahe
MozReview-Commit-ID: FDfpeEt3HfT
--- 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,