Bug 1265202 - Install mozscreenshots as a temporary add-on. r=bgrins
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Mon, 18 Apr 2016 14:21:53 -0700
changeset 331509 dadd3d52a252edd85975ff73ac404325d28598b2
parent 331508 22d11eca4d25260d79711a56f6bca102d61fbca7
child 331510 fc2da6172138c3f1eeaea6a29a3f23be6c2cca7c
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)
reviewersbgrins
bugs1265202
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1265202 - Install mozscreenshots as a temporary add-on. r=bgrins MozReview-Commit-ID: 2qw2KY1AHb0
browser/tools/mozscreenshots/head.js
browser/tools/mozscreenshots/mozscreenshots/extension/Makefile.in
--- a/browser/tools/mozscreenshots/head.js
+++ b/browser/tools/mozscreenshots/head.js
@@ -1,21 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {AddonWatcher} = Cu.import("resource://gre/modules/AddonWatcher.jsm", {});
+const chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
 const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
+const EXTENSION_DIR = "chrome://mochitests/content/extensions/mozscreenshots/browser/";
+
 let TestRunner;
 
-function setup() {
+function* setup() {
   requestLongerTimeout(20);
 
+  info("installing extension temporarily");
+  let chromeURL = Services.io.newURI(EXTENSION_DIR, null, null);
+  let dir = chromeRegistry.convertChromeURL(chromeURL).QueryInterface(Ci.nsIFileURL).file;
+  yield AddonManager.installTemporaryAddon(dir);
+
   info("Checking for mozscreenshots extension");
   return new Promise((resolve) => {
     AddonManager.getAddonByID("mozscreenshots@mozilla.org", function(aAddon) {
       isnot(aAddon, null, "The mozscreenshots extension should be installed");
       AddonWatcher.ignoreAddonPermanently(aAddon.id);
       TestRunner = Cu.import("chrome://mozscreenshots/content/TestRunner.jsm", {}).TestRunner;
       resolve();
     });
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/Makefile.in
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/Makefile.in
@@ -1,12 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
-GENERATED_DIRS =  $(TEST_EXTENSIONS_DIR)
+GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
 XPI_PKGNAME = mozscreenshots@mozilla.org
 
 include $(topsrcdir)/config/rules.mk
 
 libs::
 	(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)