Bug 1529394 revert early breakout to support test infra extensions r=rpl

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Shane Caraveo 2019-03-05 20:56:07 +00:00
parent c93bd63729
commit dc6636f2f6
2 changed files with 1 additions and 40 deletions

View File

@ -53,7 +53,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
OS: "resource://gre/modules/osfile.jsm",
PluralForm: "resource://gre/modules/PluralForm.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
Schemas: "resource://gre/modules/Schemas.jsm",
XPIProvider: "resource://gre/modules/addons/XPIProvider.jsm",
});
@ -1906,10 +1905,7 @@ class Extension extends ExtensionData {
return;
}
// We automatically add permissions to some extensions:
// 1. system/built-in extensions
// 2. all extensions when in permanent private browsing
//
// We automatically add permissions to system/built-in extensions.
// Extensions expliticy stating not_allowed will never get permission.
if (!allowPrivateBrowsingByDefault && this.manifest.incognito !== "not_allowed" &&
!this.permissions.has(PRIVATE_ALLOWED_PERMISSION)) {
@ -1944,17 +1940,6 @@ class Extension extends ExtensionData {
resolveReadyPromise(this.policy);
// When in PPB skip any startup and disable the policy if the extension
// does not have permission.
if (PrivateBrowsingUtils.permanentPrivateBrowsing && !this.privateBrowsingAllowed) {
this.state = "Startup: Cancelled: (not running in permenant private browsing mode)";
this.policy.active = false;
this.cleanupGeneratedFile();
return;
}
// The "startup" Management event sent on the extension instance itself
// is emitted just before the Management "startup" event,
// and it is used to run code that needs to be executed before

View File

@ -33,27 +33,3 @@ add_task(async function test_background_incognito() {
await extension.unload();
});
add_task(async function test_background_PPB_not_allowed() {
info("Test background page incognito value with permanent private browsing enabled");
Services.prefs.setBoolPref("extensions.allowPrivateBrowsingByDefault", false);
Services.prefs.setBoolPref("browser.privatebrowsing.autostart", true);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("browser.privatebrowsing.autostart");
Services.prefs.clearUserPref("extensions.allowPrivateBrowsingByDefault");
});
let extension = ExtensionTestUtils.loadExtension({
async background() {
browser.test.notifyFail("incognito");
},
});
await extension.startup();
let state = extension.extension.state;
ok(state.startsWith("Startup: Cancelled"), `extension startup state should be cancelled "${state}"`);
await extension.unload();
});