diff --git a/dom/apps/tests/test_bug_945152.html b/dom/apps/tests/test_bug_945152.html
index 8974692275d..fed12a8d89f 100644
--- a/dom/apps/tests/test_bug_945152.html
+++ b/dom/apps/tests/test_bug_945152.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=945152
diff --git a/dom/apps/tests/test_checkInstalled.html b/dom/apps/tests/test_checkInstalled.html
index ab4636b0af4..d8bc58cea3c 100644
--- a/dom/apps/tests/test_checkInstalled.html
+++ b/dom/apps/tests/test_checkInstalled.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={1191516}
Test for Bug {1191516}
+
@@ -92,7 +93,7 @@ function runTest() {
yield undefined;
}
-addLoadEvent(go);
+addLoadEvent(() => prepareEnv(go));
diff --git a/dom/apps/tests/test_import_export.html b/dom/apps/tests/test_import_export.html
index 036073e4176..87d12bb7c3b 100644
--- a/dom/apps/tests/test_import_export.html
+++ b/dom/apps/tests/test_import_export.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={982874}
Test for Bug {982874}
+
@@ -322,7 +323,7 @@ function runTest() {
is(request.result.length, initialAppsCount, "All apps are uninstalled.");
}
-addLoadEvent(go);
+addLoadEvent(() => prepareEnv(go));
diff --git a/dom/apps/tests/test_install_dev_mode.html b/dom/apps/tests/test_install_dev_mode.html
index bd75ad28868..b088c5e7e46 100644
--- a/dom/apps/tests/test_install_dev_mode.html
+++ b/dom/apps/tests/test_install_dev_mode.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={1111961}
Test for Bug {1111961}
+
@@ -114,7 +115,7 @@ function runTest() {
is(request.result.length, initialAppsCount, "All apps are uninstalled.");
}
-addLoadEvent(go);
+addLoadEvent(() => prepareEnv(go));
diff --git a/dom/apps/tests/test_install_multiple_apps_origin.html b/dom/apps/tests/test_install_multiple_apps_origin.html
index e31630dca2f..800c6ba026b 100644
--- a/dom/apps/tests/test_install_multiple_apps_origin.html
+++ b/dom/apps/tests/test_install_multiple_apps_origin.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={778277}
Test for Bug {778277}
+
@@ -116,7 +117,7 @@ function runTest() {
is(request.result.length, initialAppsCount, "All apps are uninstalled.");
}
-addLoadEvent(go);
+addLoadEvent(() => prepareEnv(go));
diff --git a/dom/apps/tests/test_install_receipts.html b/dom/apps/tests/test_install_receipts.html
index 302886d67e8..3ad4aea14e8 100644
--- a/dom/apps/tests/test_install_receipts.html
+++ b/dom/apps/tests/test_install_receipts.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={960837}
Test for Bug {960837}
+
@@ -206,7 +207,7 @@ function runTest() {
yield undefined;
}
-addLoadEvent(go);
+addLoadEvent(() => prepareEnv(go));
diff --git a/dom/apps/tests/test_langpacks.html b/dom/apps/tests/test_langpacks.html
index 0ee09e3ead8..8bdc1680872 100644
--- a/dom/apps/tests/test_langpacks.html
+++ b/dom/apps/tests/test_langpacks.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1108096
Test for Bug 1108096 - Langpack support
+
-
+
diff --git a/dom/apps/tests/test_marketplace_pkg_install.html b/dom/apps/tests/test_marketplace_pkg_install.html
index b41dc191592..b6cc095cf95 100644
--- a/dom/apps/tests/test_marketplace_pkg_install.html
+++ b/dom/apps/tests/test_marketplace_pkg_install.html
@@ -9,6 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=989806
+
@@ -341,7 +342,7 @@ PackagedTestHelper.setSteps([
}
]);
-addLoadEvent(PackagedTestHelper.start);
+addLoadEvent(() => prepareEnv(() => PackagedTestHelper.start()));
diff --git a/dom/apps/tests/test_operator_app_install.js b/dom/apps/tests/test_operator_app_install.js
index 2d540d20255..9f81c44e73c 100644
--- a/dom/apps/tests/test_operator_app_install.js
+++ b/dom/apps/tests/test_operator_app_install.js
@@ -212,6 +212,9 @@ function checkAppState(aApp,
}
var steps = [
+ function() {
+ prepareEnv(next);
+ },
function() {
setupDataDirs(next);
ok(true, "Data directory set up to " + singlevariantDir);
diff --git a/dom/apps/tests/test_operator_app_install.xul b/dom/apps/tests/test_operator_app_install.xul
index 3bd05526648..bd959639a27 100644
--- a/dom/apps/tests/test_operator_app_install.xul
+++ b/dom/apps/tests/test_operator_app_install.xul
@@ -8,6 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=893800
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
diff --git a/dom/apps/tests/test_packaged_app_asmjs.html b/dom/apps/tests/test_packaged_app_asmjs.html
index 26e1f2c1c05..75a955d7415 100644
--- a/dom/apps/tests/test_packaged_app_asmjs.html
+++ b/dom/apps/tests/test_packaged_app_asmjs.html
@@ -10,6 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=997886
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+
-
+
diff --git a/dom/apps/tests/test_packaged_app_install.html b/dom/apps/tests/test_packaged_app_install.html
index 4cbff025b90..f03830a955c 100644
--- a/dom/apps/tests/test_packaged_app_install.html
+++ b/dom/apps/tests/test_packaged_app_install.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={821589}
Test for Bug {821589} Packaged apps installation and update
+
@@ -347,7 +348,7 @@ var steps = [
PackagedTestHelper.setSteps(steps);
-addLoadEvent(PackagedTestHelper.start);
+addLoadEvent(() => prepareEnv(() => PackagedTestHelper.start()));
diff --git a/dom/apps/tests/test_packaged_app_update.html b/dom/apps/tests/test_packaged_app_update.html
index 6aee2074ed7..fca3d53c621 100644
--- a/dom/apps/tests/test_packaged_app_update.html
+++ b/dom/apps/tests/test_packaged_app_update.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={900533}
Test for Bug {900533} Packaged app update tests
+
@@ -346,7 +347,7 @@ PackagedTestHelper.setSteps(steps);
// install tests
miniManifestURL = PackagedTestHelper.gSJS + "?getManifest=true&appToUpdate&testNameChange";
-addLoadEvent(PackagedTestHelper.start);
+addLoadEvent(() => prepareEnv(() => PackagedTestHelper.start()));
diff --git a/dom/apps/tests/test_receipt_operations.html b/dom/apps/tests/test_receipt_operations.html
index 45a67ee92d8..960a448ecd6 100644
--- a/dom/apps/tests/test_receipt_operations.html
+++ b/dom/apps/tests/test_receipt_operations.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={757226}
Test for Bug {757226} Implement mozApps app.replaceReceipt
+
@@ -231,7 +232,7 @@ function runTest() {
ok(true, "App uninstalled");
}
-addLoadEvent(go);
+addLoadEvent(() => prepareEnv(go));
diff --git a/dom/apps/tests/test_signed_pkg_install.html b/dom/apps/tests/test_signed_pkg_install.html
index bf1b5b9c024..85b36f62f7a 100644
--- a/dom/apps/tests/test_signed_pkg_install.html
+++ b/dom/apps/tests/test_signed_pkg_install.html
@@ -8,6 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=880043
Test for Bug 880043 Packaged apps installation and update
+
@@ -269,7 +270,7 @@ var steps = [
PackagedTestHelper.setSteps(steps);
PackagedTestHelper.gSJSPath = gSJSPath;
-addLoadEvent(PackagedTestHelper.start);
+addLoadEvent(() => prepareEnv(() => PackagedTestHelper.start()));
diff --git a/dom/apps/tests/test_theme_role.html b/dom/apps/tests/test_theme_role.html
index fbdc3d18e07..6aab16b2f81 100644
--- a/dom/apps/tests/test_theme_role.html
+++ b/dom/apps/tests/test_theme_role.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={1011738}
Test for Bug {1011738}
+
@@ -102,7 +103,7 @@ function runTest() {
yield undefined;
}
-addLoadEvent(go);
+addLoadEvent(() => prepareEnv(go));
diff --git a/dom/apps/tests/test_third_party_homescreen.html b/dom/apps/tests/test_third_party_homescreen.html
index 7ca9844a546..56e269ad6d3 100644
--- a/dom/apps/tests/test_third_party_homescreen.html
+++ b/dom/apps/tests/test_third_party_homescreen.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={1097468}
Test for Bug {1097468}
+
@@ -192,7 +193,7 @@ function runTest() {
navigator.mozApps.mgmt.onuninstall = null;
}
-addLoadEvent(go);
+addLoadEvent(() => prepareEnv(go));
diff --git a/dom/apps/tests/test_uninstall_errors.html b/dom/apps/tests/test_uninstall_errors.html
index 591b76dd64c..1c70d1c4e13 100644
--- a/dom/apps/tests/test_uninstall_errors.html
+++ b/dom/apps/tests/test_uninstall_errors.html
@@ -8,6 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=830258
Test for Bug 830258
+
-
+
Mozilla Bug 830258
diff --git a/dom/apps/tests/test_web_app_install.html b/dom/apps/tests/test_web_app_install.html
index 17565f71978..eb6d45262cd 100644
--- a/dom/apps/tests/test_web_app_install.html
+++ b/dom/apps/tests/test_web_app_install.html
@@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={1075716}
Install web app from manifest with application/manifest+json MIME type
+
@@ -165,7 +166,7 @@ function runTest() {
is(request.result.length, initialAppsCount, "Correct number of apps.");
}
-addLoadEvent(go);
+addLoadEvent(() => prepareEnv(go));
diff --git a/dom/apps/tests/test_widget.html b/dom/apps/tests/test_widget.html
index 0190a6e96a1..1a4f99cfcdc 100644
--- a/dom/apps/tests/test_widget.html
+++ b/dom/apps/tests/test_widget.html
@@ -5,6 +5,7 @@
Test for Widget
+
@@ -12,7 +13,7 @@
diff --git a/dom/apps/tests/test_widget_browser.html b/dom/apps/tests/test_widget_browser.html
index e0d8f144952..366953dff85 100644
--- a/dom/apps/tests/test_widget_browser.html
+++ b/dom/apps/tests/test_widget_browser.html
@@ -5,6 +5,7 @@
Test for DataStore - basic operation on a readonly db
+
@@ -12,7 +13,7 @@
diff --git a/dom/apps/tests/unit/head.js b/dom/apps/tests/unit/head.js
new file mode 100644
index 00000000000..1c690c6afe1
--- /dev/null
+++ b/dom/apps/tests/unit/head.js
@@ -0,0 +1,4 @@
+const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+Cu.import("resource:///modules/Services.jsm");
+var dom_mozApps_debug = Services.prefs.getBoolPref("dom.mozApps.debug");
+Services.prefs.setBoolPref("dom.mozApps.debug", true);
diff --git a/dom/apps/tests/unit/tail.js b/dom/apps/tests/unit/tail.js
new file mode 100644
index 00000000000..55881de215c
--- /dev/null
+++ b/dom/apps/tests/unit/tail.js
@@ -0,0 +1 @@
+Services.prefs.setBoolPref("dom.mozApps.debug", dom_mozApps_debug);
diff --git a/dom/apps/tests/unit/test_has_widget_criterion.js b/dom/apps/tests/unit/test_has_widget_criterion.js
index ba435f20764..e9ff7ac76ca 100644
--- a/dom/apps/tests/unit/test_has_widget_criterion.js
+++ b/dom/apps/tests/unit/test_has_widget_criterion.js
@@ -1,10 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
Cu.import("resource:///modules/AppsUtils.jsm");
-Cu.import("resource:///modules/Services.jsm");
add_test(function test_has_widget_criterion() {
diff --git a/dom/apps/tests/unit/test_inter_app_comm_service.js b/dom/apps/tests/unit/test_inter_app_comm_service.js
index 806a112e1e0..27d000a7881 100644
--- a/dom/apps/tests/unit/test_inter_app_comm_service.js
+++ b/dom/apps/tests/unit/test_inter_app_comm_service.js
@@ -1,9 +1,6 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/InterAppCommService.jsm");
Cu.import("resource://gre/modules/AppConstants.jsm");
diff --git a/dom/apps/tests/unit/test_moziapplication.js b/dom/apps/tests/unit/test_moziapplication.js
index b7989f82e04..56ac70142d2 100644
--- a/dom/apps/tests/unit/test_moziapplication.js
+++ b/dom/apps/tests/unit/test_moziapplication.js
@@ -1,8 +1,6 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
-const {interfaces: Ci, utils: Cu} = Components;
-
Cu.import("resource:///modules/AppsUtils.jsm");
add_test(() => {
diff --git a/dom/apps/tests/unit/xpcshell.ini b/dom/apps/tests/unit/xpcshell.ini
index 49b4539847d..a0adc6e0612 100644
--- a/dom/apps/tests/unit/xpcshell.ini
+++ b/dom/apps/tests/unit/xpcshell.ini
@@ -1,6 +1,6 @@
[DEFAULT]
-head =
-tail =
+head = head.js
+tail = tail.js
[test_has_widget_criterion.js]
[test_inter_app_comm_service.js]
diff --git a/testing/profiles/prefs_general.js b/testing/profiles/prefs_general.js
index b2c9678306e..b8e0e469d3c 100644
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -271,8 +271,6 @@ user_pref("browser.translation.engine", "bing");
// Make sure we don't try to load snippets from the network.
user_pref("browser.aboutHomeSnippets.updateUrl", "nonexistent://test");
-// Enable debug logging in the mozApps implementation.
-user_pref("dom.mozApps.debug", true);
// Enable apps customizations
user_pref("dom.apps.customization.enabled", true);
diff --git a/toolkit/webapps/tests/head.js b/toolkit/webapps/tests/head.js
index 679b6e8baa7..49d66e81fdf 100644
--- a/toolkit/webapps/tests/head.js
+++ b/toolkit/webapps/tests/head.js
@@ -586,3 +586,7 @@ AlertsService.init();
SimpleTest.registerCleanupFunction(() => {
AlertsService.restore();
});
+
+function prepareEnv(cb) {
+ SpecialPowers.pushPrefEnv({"set":[["dom.mozApps.debug", true]]}, cb);
+}
diff --git a/toolkit/webapps/tests/test_custom_origin.xul b/toolkit/webapps/tests/test_custom_origin.xul
index 70b580595a3..02007add1a8 100644
--- a/toolkit/webapps/tests/test_custom_origin.xul
+++ b/toolkit/webapps/tests/test_custom_origin.xul
@@ -125,10 +125,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_custom_origin_uninstall_install.xul b/toolkit/webapps/tests/test_custom_origin_uninstall_install.xul
index 9d7d3cc8fad..e1d325e9d72 100644
--- a/toolkit/webapps/tests/test_custom_origin_uninstall_install.xul
+++ b/toolkit/webapps/tests/test_custom_origin_uninstall_install.xul
@@ -161,10 +161,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_hosted.xul b/toolkit/webapps/tests/test_hosted.xul
index 3780371b1eb..d3e12391a08 100644
--- a/toolkit/webapps/tests/test_hosted.xul
+++ b/toolkit/webapps/tests/test_hosted.xul
@@ -147,10 +147,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_hosted_checkforupdates_from_webapp_runtime.xul b/toolkit/webapps/tests/test_hosted_checkforupdates_from_webapp_runtime.xul
index 52ab3ce99de..c5716d1f699 100644
--- a/toolkit/webapps/tests/test_hosted_checkforupdates_from_webapp_runtime.xul
+++ b/toolkit/webapps/tests/test_hosted_checkforupdates_from_webapp_runtime.xul
@@ -106,10 +106,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_hosted_icons.xul b/toolkit/webapps/tests/test_hosted_icons.xul
index a9a85e67ba0..ca71b945a9d 100644
--- a/toolkit/webapps/tests/test_hosted_icons.xul
+++ b/toolkit/webapps/tests/test_hosted_icons.xul
@@ -147,10 +147,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_hosted_launch.xul b/toolkit/webapps/tests/test_hosted_launch.xul
index 234502603b3..96928ca0f5f 100644
--- a/toolkit/webapps/tests/test_hosted_launch.xul
+++ b/toolkit/webapps/tests/test_hosted_launch.xul
@@ -93,10 +93,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_hosted_launch_no_registry.xul b/toolkit/webapps/tests/test_hosted_launch_no_registry.xul
index 2b54d0952a2..b0f61e76073 100644
--- a/toolkit/webapps/tests/test_hosted_launch_no_registry.xul
+++ b/toolkit/webapps/tests/test_hosted_launch_no_registry.xul
@@ -93,10 +93,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_hosted_uninstall.xul b/toolkit/webapps/tests/test_hosted_uninstall.xul
index 0df9e524ca4..0898931b58e 100644
--- a/toolkit/webapps/tests/test_hosted_uninstall.xul
+++ b/toolkit/webapps/tests/test_hosted_uninstall.xul
@@ -135,10 +135,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_hosted_update_from_webapp_runtime.xul b/toolkit/webapps/tests/test_hosted_update_from_webapp_runtime.xul
index af3c5a46e2f..4675b8b865c 100644
--- a/toolkit/webapps/tests/test_hosted_update_from_webapp_runtime.xul
+++ b/toolkit/webapps/tests/test_hosted_update_from_webapp_runtime.xul
@@ -110,10 +110,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_install_appcache.xul b/toolkit/webapps/tests/test_install_appcache.xul
index ccd38191b37..bae929daa99 100644
--- a/toolkit/webapps/tests/test_install_appcache.xul
+++ b/toolkit/webapps/tests/test_install_appcache.xul
@@ -116,10 +116,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_non_ascii_app_name.xul b/toolkit/webapps/tests/test_non_ascii_app_name.xul
index 7fd8018df0b..06591ba49b4 100644
--- a/toolkit/webapps/tests/test_non_ascii_app_name.xul
+++ b/toolkit/webapps/tests/test_non_ascii_app_name.xul
@@ -148,10 +148,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_packaged.xul b/toolkit/webapps/tests/test_packaged.xul
index 7765df3bf26..91d8ee41ba0 100644
--- a/toolkit/webapps/tests/test_packaged.xul
+++ b/toolkit/webapps/tests/test_packaged.xul
@@ -164,10 +164,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_packaged_checkforupdates_from_webapp_runtime.xul b/toolkit/webapps/tests/test_packaged_checkforupdates_from_webapp_runtime.xul
index 3cbfd97a2fe..4a3f08d4d37 100644
--- a/toolkit/webapps/tests/test_packaged_checkforupdates_from_webapp_runtime.xul
+++ b/toolkit/webapps/tests/test_packaged_checkforupdates_from_webapp_runtime.xul
@@ -118,10 +118,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_packaged_icons.xul b/toolkit/webapps/tests/test_packaged_icons.xul
index 15614faea7a..8dfba521b29 100644
--- a/toolkit/webapps/tests/test_packaged_icons.xul
+++ b/toolkit/webapps/tests/test_packaged_icons.xul
@@ -160,10 +160,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_packaged_launch.xul b/toolkit/webapps/tests/test_packaged_launch.xul
index c1643cbc336..bd939d78038 100644
--- a/toolkit/webapps/tests/test_packaged_launch.xul
+++ b/toolkit/webapps/tests/test_packaged_launch.xul
@@ -101,10 +101,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_packaged_launch_no_registry.xul b/toolkit/webapps/tests/test_packaged_launch_no_registry.xul
index d6b74aed154..8176c665b40 100644
--- a/toolkit/webapps/tests/test_packaged_launch_no_registry.xul
+++ b/toolkit/webapps/tests/test_packaged_launch_no_registry.xul
@@ -101,10 +101,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_packaged_uninstall.xul b/toolkit/webapps/tests/test_packaged_uninstall.xul
index 2f9fd96638e..266e141d1b8 100644
--- a/toolkit/webapps/tests/test_packaged_uninstall.xul
+++ b/toolkit/webapps/tests/test_packaged_uninstall.xul
@@ -144,10 +144,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_packaged_update_from_webapp_runtime.xul b/toolkit/webapps/tests/test_packaged_update_from_webapp_runtime.xul
index 593469185cd..908a27eb030 100644
--- a/toolkit/webapps/tests/test_packaged_update_from_webapp_runtime.xul
+++ b/toolkit/webapps/tests/test_packaged_update_from_webapp_runtime.xul
@@ -124,10 +124,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>
diff --git a/toolkit/webapps/tests/test_webapp_runtime_executable_update.xul b/toolkit/webapps/tests/test_webapp_runtime_executable_update.xul
index 02bd9ce75f5..655de8dd1a6 100644
--- a/toolkit/webapps/tests/test_webapp_runtime_executable_update.xul
+++ b/toolkit/webapps/tests/test_webapp_runtime_executable_update.xul
@@ -152,10 +152,10 @@ let runTest = Task.async(function*() {
SimpleTest.finish();
});
-runTest().catch((e) => {
+prepareEnv(() => runTest().catch((e) => {
ok(false, "Error during test: " + e);
SimpleTest.finish();
-});
+}));
]]>