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 275058 d0d6aa6c7ace82fd4062ff4b1ced79e8b84bd175
parent 275057 c58332063a0a28ae9eec3d1760cf3510a9100f1a
child 275059 69d21e7b13856672fc663423931f9d4c7cd3d4ab
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, lizzard
bugs1173144
milestone40.0a2
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;
   }