Bug 1173144 - Ensure Adobe EME plugin voucher is present before adding GMP dir to GMPService. r=dolske, a=lizzard
authorChris Pearce <cpearce@mozilla.com>
Fri, 12 Jun 2015 20:26:06 -0700
changeset 266260 05b522f50491
parent 266259 adb302d8d588
child 266261 27f4ef5f8ba6
child 266263 d37292f9d637
child 266265 4b179ee95998
push id4804
push userryanvm@gmail.com
push date2015-06-15 15:02 +0000
treeherdermozilla-beta@05b522f50491 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, lizzard
bugs1173144
milestone39.0
Bug 1173144 - Ensure Adobe EME plugin voucher is present before adding GMP dir to GMPService. r=dolske, a=lizzard
toolkit/mozapps/extensions/internal/GMPProvider.jsm
toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js
--- a/toolkit/mozapps/extensions/internal/GMPProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/GMPProvider.jsm
@@ -464,17 +464,19 @@ GMPWrapper.prototype = {
       f.initWithPath(path);
       return f.exists();
     };
 
     let id = this._plugin.id.substring(4);
     let libName = AppConstants.DLL_PREFIX + id + AppConstants.DLL_SUFFIX;
 
     return fileExists(this.gmpPath, libName) &&
-           fileExists(this.gmpPath, id + ".info");
+           fileExists(this.gmpPath, id + ".info") &&
+           (this._plugin.id != EME_ADOBE_ID ||
+            fileExists(this.gmpPath, id + ".voucher"));
   },
 
   validate: function() {
     return !this.isInstalled ||
            this._arePluginFilesOnDisk();
   },
 };
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js
@@ -230,16 +230,18 @@ function createMockPluginFilesIfNeeded(a
     }
   };
 
   let id = aPluginId.substring(4);
   let libName = AppConstants.DLL_PREFIX + id + AppConstants.DLL_SUFFIX;
   
   createFile(libName);
   createFile(id + ".info");
+  if (aPluginId == "gmp-eme-adobe")
+    createFile(id + ".voucher");
 }
 
 // Array.includes is only in 41, so polyfill for 40/39 uplift.
 if (![].includes) {
   Array.prototype.includes = function(element) {
     var O = Object(this);
     return O.indexOf(element) != -1;
   }