Bug 1272521 - Hide Widevine CDM on MacOSX 10.6. r=spohl a=ritu CLOSED TREE
authorChris Pearce <cpearce@mozilla.com>
Fri, 13 May 2016 14:02:20 +1200
changeset 332894 17724486e1591858eea09dc327475a25883854a4
parent 332893 9e49e1b06115a91c47b0184e535774deec4453a9
child 332895 049fb75980cf45695110c8b6ef105f06d10cbe0c
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl, ritu
bugs1272521
milestone48.0a2
Bug 1272521 - Hide Widevine CDM on MacOSX 10.6. r=spohl a=ritu CLOSED TREE The Widevine CDM crashes on MacOSX 10.6, so only download, expose, and install it on 10.7 and later. MozReview-Commit-ID: 51iJpQEB1m7
toolkit/modules/GMPUtils.jsm
toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js
--- a/toolkit/modules/GMPUtils.jsm
+++ b/toolkit/modules/GMPUtils.jsm
@@ -75,20 +75,19 @@ this.GMPUtils = {
         // Non-Windows OSes currently unsupported by Adobe EME
         this.maybeReportTelemetry(aPlugin.id,
                                   "VIDEO_EME_ADOBE_UNSUPPORTED_REASON",
                                   GMPPluginUnsupportedReason.NOT_WINDOWS);
         return false;
       }
     } 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;
     }
 
     return true;
   },
 
--- a/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js
@@ -1,15 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 "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");
 
 const TEST_DATE = new Date(2013, 0, 1, 12);
 
 var gManagerWindow;
 var gCategoryUtilities;
 var gIsEnUsLocale;
@@ -381,19 +382,18 @@ add_task(function* testEmeSupport() {
     if (addon.id == GMPScope.EME_ADOBE_ID) {
       if (Services.appinfo.OS == "WINNT") {
         Assert.ok(item, "Adobe EME supported, found add-on element.");
       } else {
         Assert.ok(!item,
                   "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,
                   "Widevine not supported, couldn't find add-on element.");
       }
     } else {
       Assert.ok(item, "Found add-on element.");
     }