diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-10 02:51:36 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-10 02:51:36 -0500 |
commit | 37d5300335d81cecbecc99812747a657588c63eb (patch) | |
tree | 765efa3b6a56bb715d9813a8697473e120436278 /toolkit/mozapps/extensions/test/xpcshell/test_provider_markSafe.js | |
parent | b2bdac20c02b12f2057b9ef70b0a946113a00e00 (diff) | |
parent | 4fb11cd5966461bccc3ed1599b808237be6b0de9 (diff) | |
download | UXP-37d5300335d81cecbecc99812747a657588c63eb.tar UXP-37d5300335d81cecbecc99812747a657588c63eb.tar.gz UXP-37d5300335d81cecbecc99812747a657588c63eb.tar.lz UXP-37d5300335d81cecbecc99812747a657588c63eb.tar.xz UXP-37d5300335d81cecbecc99812747a657588c63eb.zip |
Merge branch 'ext-work'
Diffstat (limited to 'toolkit/mozapps/extensions/test/xpcshell/test_provider_markSafe.js')
-rw-r--r-- | toolkit/mozapps/extensions/test/xpcshell/test_provider_markSafe.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_provider_markSafe.js b/toolkit/mozapps/extensions/test/xpcshell/test_provider_markSafe.js deleted file mode 100644 index 228eb7d34..000000000 --- a/toolkit/mozapps/extensions/test/xpcshell/test_provider_markSafe.js +++ /dev/null @@ -1,49 +0,0 @@ -createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); - -var startupOrder = []; - -function mockAddonProvider(name) { - let mockProvider = { - markSafe: false, - apiAccessed: false, - - startup() { - if (this.markSafe) - AddonManagerPrivate.markProviderSafe(this); - - let uri = Services.io.newURI("beard://long", null, null); - AddonManager.isInstallEnabled("made-up-mimetype"); - }, - supportsMimetype(mimetype) { - this.apiAccessed = true; - return false; - }, - - get name() { - return name; - }, - }; - - return mockProvider; -} - -function run_test() { - run_next_test(); -} - -add_task(function* testMarkSafe() { - do_print("Starting with provider normally"); - let provider = mockAddonProvider("Mock1"); - AddonManagerPrivate.registerProvider(provider); - startupManager(); - ok(!provider.apiAccessed, "Provider API should not have been accessed"); - AddonManagerPrivate.unregisterProvider(provider); - yield promiseShutdownManager(); - - do_print("Starting with provider that marks itself safe"); - provider.apiAccessed = false; - provider.markSafe = true; - AddonManagerPrivate.registerProvider(provider); - startupManager(); - ok(provider.apiAccessed, "Provider API should have been accessed"); -}); |