summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/test/xpcshell/test_bug596607.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/mozapps/extensions/test/xpcshell/test_bug596607.js')
-rw-r--r--toolkit/mozapps/extensions/test/xpcshell/test_bug596607.js37
1 files changed, 15 insertions, 22 deletions
diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug596607.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug596607.js
index bdcf93a1f..3e655dc87 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug596607.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug596607.js
@@ -38,18 +38,11 @@ const addon2Dir = writeInstallRDFForExtension(addon2, gProfD, "addon2");
const addon3Dir = gProfD.clone();
addon3Dir.append("addon3@tests.mozilla.org");
-let registry;
-
function run_test() {
// This test only works where there is a registry.
if (!("nsIWindowsRegKey" in AM_Ci))
return;
- registry = new MockRegistry();
- do_register_cleanup(() => {
- registry.shutdown();
- });
-
do_test_pending();
run_test_1();
@@ -57,15 +50,15 @@ function run_test() {
// Tests whether starting a fresh profile with a bad entry works
function run_test_1() {
- registry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
- "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
- "addon1@tests.mozilla.org", addon1Dir.path);
- registry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
- "addon2@tests.mozilla.org", addon2Dir.path);
- registry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
- "addon3@tests.mozilla.org", addon3Dir.path);
+ MockRegistry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
+ "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
+ "addon1@tests.mozilla.org", addon1Dir.path);
+ MockRegistry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
+ "addon2@tests.mozilla.org", addon2Dir.path);
+ MockRegistry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
+ "addon3@tests.mozilla.org", addon3Dir.path);
startupManager();
@@ -92,9 +85,9 @@ function run_test_1() {
function run_test_2() {
shutdownManager();
- registry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
- "addon3@tests.mozilla.org", addon3Dir.path);
+ MockRegistry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
+ "addon3@tests.mozilla.org", addon3Dir.path);
startupManager(false);
@@ -121,9 +114,9 @@ function run_test_2() {
function run_test_3() {
shutdownManager();
- registry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
- "addon3@tests.mozilla.org", null);
+ MockRegistry.setValue(AM_Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "SOFTWARE\\Mozilla\\XPCShell\\Extensions",
+ "addon3@tests.mozilla.org", null);
startupManager(false);