From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../test_browserGlue_migration_social_cleanup.js | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 browser/components/tests/unit/test_browserGlue_migration_social_cleanup.js (limited to 'browser/components/tests/unit/test_browserGlue_migration_social_cleanup.js') diff --git a/browser/components/tests/unit/test_browserGlue_migration_social_cleanup.js b/browser/components/tests/unit/test_browserGlue_migration_social_cleanup.js new file mode 100644 index 0000000000..00b59202a4 --- /dev/null +++ b/browser/components/tests/unit/test_browserGlue_migration_social_cleanup.js @@ -0,0 +1,30 @@ +const UI_VERSION = 69; +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(async function test_check_cleanup_social_prefs() { + Services.prefs.setStringPref("social.manifest.example-com", "example.com"); + + // Simulate a migration. + gBrowserGlue.observe( + null, + TOPIC_BROWSERGLUE_TEST, + TOPICDATA_BROWSERGLUE_TEST + ); + + Assert.ok( + !Services.prefs.prefHasUserValue("social.manifest.example-com"), + "should have cleared old social preference 'social.manifest.example-com'" + ); +}); + +registerCleanupFunction(() => { + Services.prefs.clearUserPref("browser.migration.version"); + Services.prefs.clearUserPref("social.manifest.example-com"); +}); -- cgit v1.2.3