Bug 1527330 - Fix test_ext_userScript_exports.js failure on beta. r=robwu
authorLuca Greco <lgreco@mozilla.com>
Wed, 13 Feb 2019 17:30:20 +0000
changeset 458928 b1b031c761f5
parent 458927 7897f18e59f5
child 458929 8f6fc796dca2
push id35551
push usershindli@mozilla.com
push dateWed, 13 Feb 2019 21:34:09 +0000
treeherdermozilla-central@08f794a4928e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrobwu
bugs1527330
milestone67.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 1527330 - Fix test_ext_userScript_exports.js failure on beta. r=robwu Differential Revision: https://phabricator.services.mozilla.com/D19533
toolkit/components/extensions/test/xpcshell/test_ext_userScripts_exports.js
--- a/toolkit/components/extensions/test/xpcshell/test_ext_userScripts_exports.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_userScripts_exports.js
@@ -8,16 +8,22 @@ AddonTestUtils.init(this);
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "49");
 
 const server = createHttpServer();
 server.registerDirectory("/data/", do_get_file("data"));
 
 const BASE_URL = `http://localhost:${server.identity.primaryPort}/data`;
 
+// Turn on the userScripts API using the related pref.
+Services.prefs.setBoolPref("extensions.webextensions.userScripts.enabled", true);
+registerCleanupFunction(() => {
+  Services.prefs.clearUserPref("extensions.webextensions.userScripts.enabled");
+});
+
 // A small utility function used to test the expected behaviors of the userScripts API method
 // wrapper.
 async function test_userScript_APIMethod({
   apiScript, userScript, userScriptMetadata, testFn,
   runtimeMessageListener,
 }) {
   async function backgroundScript(userScriptFn, scriptMetadata, messageListener) {
     await browser.userScripts.register({