summaryrefslogtreecommitdiffstats
path: root/browser/components/tests/unit/test_browserGlue_migration_loop_cleanup.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /browser/components/tests/unit/test_browserGlue_migration_loop_cleanup.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/components/tests/unit/test_browserGlue_migration_loop_cleanup.js')
-rw-r--r--browser/components/tests/unit/test_browserGlue_migration_loop_cleanup.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/browser/components/tests/unit/test_browserGlue_migration_loop_cleanup.js b/browser/components/tests/unit/test_browserGlue_migration_loop_cleanup.js
new file mode 100644
index 000000000..a68503db3
--- /dev/null
+++ b/browser/components/tests/unit/test_browserGlue_migration_loop_cleanup.js
@@ -0,0 +1,32 @@
+const UI_VERSION = 41;
+const TOPIC_BROWSERGLUE_TEST = "browser-glue-test";
+const TOPICDATA_BROWSERGLUE_TEST = "force-ui-migration";
+
+var gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"]
+ .getService(Ci.nsIObserver);
+
+Services.prefs.setIntPref("browser.migration.version", UI_VERSION - 1);
+
+add_task(function* test_check_cleanup_loop_prefs() {
+ Services.prefs.setBoolPref("loop.createdRoom", true);
+ Services.prefs.setBoolPref("loop1.createdRoom", true);
+ Services.prefs.setBoolPref("loo.createdRoom", true);
+
+ // Simulate a migration.
+ gBrowserGlue.observe(null, TOPIC_BROWSERGLUE_TEST, TOPICDATA_BROWSERGLUE_TEST);
+
+ Assert.throws(() => Services.prefs.getBoolPref("loop.createdRoom"),
+ /NS_ERROR_UNEXPECTED/,
+ "should have cleared old loop preference 'loop.createdRoom'");
+ Assert.ok(Services.prefs.getBoolPref("loop1.createdRoom"),
+ "should have left non-loop pref 'loop1.createdRoom' untouched");
+ Assert.ok(Services.prefs.getBoolPref("loo.createdRoom"),
+ "should have left non-loop pref 'loo.createdRoom' untouched");
+});
+
+do_register_cleanup(() => {
+ Services.prefs.clearUserPref("browser.migration.version");
+ Services.prefs.clearUserPref("loop.createdRoom");
+ Services.prefs.clearUserPref("loop1.createdRoom");
+ Services.prefs.clearUserPref("loo.createdRoom");
+});