Backed out 2 changesets (bug 1529394) for bc failures at automation.py on a CLOSED TREE

Backed out changeset 7f3e254c982c (bug 1529394)
Backed out changeset 3a8c338af709 (bug 1529394)
This commit is contained in:
Andreea Pavel 2019-03-05 01:34:50 +02:00
Родитель 842cf2b27c
Коммит 5d350a5796
17 изменённых файлов: 11 добавлений и 73 удалений

Просмотреть файл

@ -4,7 +4,6 @@
add_task(async function testIncognitoPopup() {
let extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
manifest: {
"permissions": ["tabs"],
"browser_action": {

Просмотреть файл

@ -7,7 +7,6 @@ add_task(async function testIncognitoViews() {
EventUtils.synthesizeMouseAtCenter(gURLBar.textbox, {type: "mouseover"}, window);
let extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
manifest: {
"permissions": ["tabs"],
"browser_action": {

Просмотреть файл

@ -31,7 +31,6 @@ add_task(async function() {
];
let extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
manifest: {
"permissions": ["tabs", "cookies"],
},

Просмотреть файл

@ -12,7 +12,6 @@ add_task(async function perma_private_browsing_mode() {
true, "Permanent private browsing is enabled");
let extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
manifest: {
"permissions": ["tabs", "cookies"],
},

Просмотреть файл

@ -83,7 +83,6 @@ add_task(async function test_urlbar_focus() {
add_task(async function default_url() {
const extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
manifest: {
permissions: ["tabs"],
},

Просмотреть файл

@ -28,7 +28,6 @@ add_task(async function invalid_cookieStoreId() {
]});
let extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
manifest: {
permissions: ["cookies"],
},
@ -65,7 +64,6 @@ add_task(async function perma_private_browsing_mode() {
await SpecialPowers.pushPrefEnv({set: [["browser.privatebrowsing.autostart", true]]});
let extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
manifest: {
"permissions": ["tabs", "cookies"],
},
@ -242,7 +240,6 @@ add_task(async function cookieStoreId_and_tabId() {
]});
let extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
manifest: {
permissions: ["cookies"],
},

Просмотреть файл

@ -139,7 +139,6 @@ add_task(async function testWindowCreate() {
}
let extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
manifest: {
"permissions": ["tabs"],
},

Просмотреть файл

@ -846,11 +846,8 @@ add_task(async function testExtensionControlledProxyConfig() {
verifyState(mainDoc, false);
// Install an extension that controls proxy settings. The extension needs
// incognitoOverride because controlling the proxy.settings requires private
// browsing access.
// Install an extension that controls proxy settings.
let extension = ExtensionTestUtils.loadExtension({
incognitoOverride: "spanning",
useAddonManager: "permanent",
manifest: {
name: "set_proxy",

Просмотреть файл

@ -530,18 +530,11 @@ VARCACHE_PREF(
// Extension prefs
//---------------------------------------------------------------------------
#ifdef ANDROID
// Private browsing opt-in is only supported on Firefox desktop.
# define PREF_VALUE true
#else
# define PREF_VALUE false
#endif
VARCACHE_PREF(
"extensions.allowPrivateBrowsingByDefault",
extensions_allowPrivateBrowsingByDefault,
bool, PREF_VALUE
bool, true
)
#undef PREF_VALUE
//---------------------------------------------------------------------------
// Full-screen prefs

Просмотреть файл

@ -340,18 +340,6 @@ ExtensionTestCommon = class ExtensionTestCommon {
return ExtensionPermissions.add(id, {permissions: ["internal:privateBrowsingAllowed"], origins: []});
}
static setExtensionID(data) {
try {
if (data.manifest.applications.gecko.id) {
return;
}
} catch (e) {
// No ID is set.
}
provide(data, ["manifest", "applications", "gecko", "id"],
uuidGen.generateUUID().number);
}
/**
* Generates a new extension using |Extension.generateXPI|, and initializes a
* new |Extension| instance which will execute it.

Просмотреть файл

@ -586,13 +586,12 @@ class AOMExtensionWrapper extends ExtensionWrapper {
}
class InstallableWrapper extends AOMExtensionWrapper {
constructor(testScope, xpiFile, addonData = {}) {
constructor(testScope, xpiFile, installType, installTelemetryInfo) {
super(testScope);
this.file = xpiFile;
this.addonData = addonData;
this.installType = addonData.useAddonManager || "temporary";
this.installTelemetryInfo = addonData.amInstallTelemetryInfo;
this.installType = installType;
this.installTelemetryInfo = installTelemetryInfo;
this.cleanupFiles = [xpiFile];
}
@ -618,26 +617,7 @@ class InstallableWrapper extends AOMExtensionWrapper {
}
}
_setIncognitoOverride() {
// this.id is not set yet so grab it from the manifest data to set
// the incognito permission.
let {addonData} = this;
if (addonData && addonData.incognitoOverride) {
try {
let {id} = addonData.manifest.applications.gecko;
if (id) {
return ExtensionTestCommon.setIncognitoOverride({id, addonData});
}
} catch (e) {}
throw new Error("Extension ID is required for setting incognito permission.");
}
}
async _install(xpiFile) {
// Timing here is different than in MockExtension so we need to handle
// incognitoOverride early.
await this._setIncognitoOverride();
_install(xpiFile) {
if (this.installType === "temporary") {
return AddonManager.installTemporaryAddon(xpiFile).then(addon => {
this.id = addon.id;
@ -803,14 +783,9 @@ var ExtensionTestUtils = {
loadExtension(data) {
if (data.useAddonManager) {
// If we're using incognitoOverride, we'll need to ensure
// an ID is available before generating the XPI.
if (data.incognitoOverride) {
ExtensionTestCommon.setExtensionID(data);
}
let xpiFile = ExtensionTestCommon.generateXPI(data);
return this.loadExtensionXPI(xpiFile, data);
return this.loadExtensionXPI(xpiFile, data.useAddonManager, data.amInstallTelemetryInfo);
}
let extension = ExtensionTestCommon.generate(data);
@ -818,8 +793,8 @@ var ExtensionTestUtils = {
return new ExtensionWrapper(this.currentScope, extension);
},
loadExtensionXPI(xpiFile, data) {
return new InstallableWrapper(this.currentScope, xpiFile, data);
loadExtensionXPI(xpiFile, useAddonManager = "temporary", installTelemetryInfo) {
return new InstallableWrapper(this.currentScope, xpiFile, useAddonManager, installTelemetryInfo);
},
// Create a wrapper for a webextension that will be installed

Просмотреть файл

@ -36,7 +36,6 @@ add_task(async function test_in_incognito_context_true() {
<script src="tab.js"><\/script>
</head></html>`,
},
incognitoOverride: "spanning",
});
await extension.startup();

Просмотреть файл

@ -104,7 +104,6 @@ add_task(async function test_downloads() {
manifest: {
permissions: ["downloads"],
},
incognitoOverride: "spanning",
});
function download(options) {

Просмотреть файл

@ -57,7 +57,6 @@ add_task(async function test_extension_incognito_privileged() {
add_task(async function test_extension_incognito_spanning_grandfathered() {
await AddonTestUtils.promiseStartupManager();
Services.prefs.setBoolPref("extensions.allowPrivateBrowsingByDefault", true);
Services.prefs.setBoolPref("extensions.incognito.migrated", false);
// This extension gets disabled before the "upgrade", it should not
// get grandfathered permissions.
@ -128,5 +127,4 @@ add_task(async function test_extension_incognito_spanning_grandfathered() {
await wrapper.unload();
await disabledWrapper.unload();
Services.prefs.clearUserPref("extensions.allowPrivateBrowsingByDefault");
Services.prefs.clearUserPref("extensions.incognito.migrated");
});

Просмотреть файл

@ -585,7 +585,7 @@ add_task(async function test_permissions_prompt() {
});
// Check that internal permissions can not be set and are not returned by the API.
add_task(async function test_internal_permissions() {
add_task(async function test_internal_permisisons() {
Services.prefs.setBoolPref("extensions.allowPrivateBrowsingByDefault", false);
function background() {
@ -617,6 +617,7 @@ add_task(async function test_internal_permissions() {
description: "permissions test",
manifest_version: 2,
version: "1.0",
permissions: [],
},
useAddonManager: "permanent",

Просмотреть файл

@ -68,7 +68,6 @@ add_task(async function test_browser_settings() {
manifest: {
permissions: ["proxy"],
},
incognitoOverride: "spanning",
useAddonManager: "temporary",
});
@ -418,7 +417,6 @@ add_task(async function test_bad_value_proxy_config() {
manifest: {
permissions: ["proxy"],
},
incognitoOverride: "spanning",
});
await extension.startup();

Просмотреть файл

@ -59,7 +59,6 @@ add_task(async function test_proxy_settings() {
"<all_urls>",
],
},
incognitoOverride: "spanning",
useAddonManager: "temporary",
background: `(${background})("${proxy.identity.primaryHost}", ${proxy.identity.primaryPort})`,
});