From 37daf2b55c3eb765ee949cba16eeaadb3595b212 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Fri, 13 May 2016 14:02:20 +1200 Subject: [PATCH] Bug 1272521 - Hide Widevine CDM on MacOSX 10.6. r=spohl The Widevine CDM crashes on MacOSX 10.6, so only download, expose, and install it on 10.7 and later. MozReview-Commit-ID: 51iJpQEB1m7 --HG-- extra : rebase_source : e24e8d8179f22f77c3e5fbfef8489aca7c4fecb9 --- toolkit/modules/GMPUtils.jsm | 7 +++---- .../mozapps/extensions/test/browser/browser_gmpProvider.js | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/toolkit/modules/GMPUtils.jsm b/toolkit/modules/GMPUtils.jsm index 4f8336cad773..53356f34e391 100644 --- a/toolkit/modules/GMPUtils.jsm +++ b/toolkit/modules/GMPUtils.jsm @@ -80,10 +80,9 @@ this.GMPUtils = { } } else if (aPlugin.id == WIDEVINE_ID) { // The Widevine plugin is available for Windows versions Vista and later - // and Mac - if ((Services.appinfo.OS == "WINNT" && - Services.sysinfo.getPropertyAsInt32("version") >= 6) || - Services.appinfo.OS == "Darwin") { + // and Mac OSX 10.7 and later. + if (AppConstants.isPlatformAndVersionAtLeast("win", "6") || + AppConstants.isPlatformAndVersionAtLeast("macosx", "10.7")) { return true; } return false; diff --git a/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js b/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js index 034403205fa1..757e1a6ff0d9 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js +++ b/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js @@ -5,6 +5,7 @@ "use strict"; Cu.import("resource://gre/modules/Promise.jsm"); +Cu.import("resource://gre/modules/AppConstants.jsm"); var {AddonTestUtils} = Cu.import("resource://testing-common/AddonManagerTesting.jsm", {}); var GMPScope = Cu.import("resource://gre/modules/addons/GMPProvider.jsm"); @@ -386,9 +387,8 @@ add_task(function* testEmeSupport() { "Adobe EME not supported, couldn't find add-on element."); } } else if (addon.id == GMPScope.WIDEVINE_ID) { - if ((Services.appinfo.OS == "WINNT" && - Services.sysinfo.getPropertyAsInt32("version") >= 6) || - Services.appinfo.OS == "Darwin") { + if (AppConstants.isPlatformAndVersionAtLeast("win", "6") || + AppConstants.isPlatformAndVersionAtLeast("macosx", "10.7")) { Assert.ok(item, "Widevine supported, found add-on element."); } else { Assert.ok(!item,