fune/browser/components/tests/unit/test_browserGlue_migration_social_cleanup.js
Victor Porof 1f830c96da Bug 1561435 - Format browser/components/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D36042

--HG--
extra : source : d3afcafdce650a6f36cebbc126ee93b17f13cf52
2019-07-05 09:53:32 +02:00

30 lines
894 B
JavaScript

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");
});