diff options
Diffstat (limited to 'toolkit/components/webextensions/test/xpcshell/test_ext_background_private_browsing.js')
-rw-r--r-- | toolkit/components/webextensions/test/xpcshell/test_ext_background_private_browsing.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_background_private_browsing.js b/toolkit/components/webextensions/test/xpcshell/test_ext_background_private_browsing.js deleted file mode 100644 index 8e8b5e0b0..000000000 --- a/toolkit/components/webextensions/test/xpcshell/test_ext_background_private_browsing.js +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -Cu.import("resource://gre/modules/Preferences.jsm"); - -function* testBackgroundPage(expected) { - let extension = ExtensionTestUtils.loadExtension({ - async background() { - browser.test.assertEq(window, browser.extension.getBackgroundPage(), - "Caller should be able to access itself as a background page"); - browser.test.assertEq(window, await browser.runtime.getBackgroundPage(), - "Caller should be able to access itself as a background page"); - - browser.test.sendMessage("incognito", browser.extension.inIncognitoContext); - }, - }); - - yield extension.startup(); - - let incognito = yield extension.awaitMessage("incognito"); - equal(incognito, expected.incognito, "Expected incognito value"); - - yield extension.unload(); -} - -add_task(function* test_background_incognito() { - do_print("Test background page incognito value with permanent private browsing disabled"); - - yield testBackgroundPage({incognito: false}); - - do_print("Test background page incognito value with permanent private browsing enabled"); - - Preferences.set("browser.privatebrowsing.autostart", true); - do_register_cleanup(() => { - Preferences.reset("browser.privatebrowsing.autostart"); - }); - - yield testBackgroundPage({incognito: true}); -}); |