Backed out 2 changesets (bug 1253129) for failures on browser_ext_windows_create_params.js. CLOSED TREE

Backed out changeset 1881ebd34b2b (bug 1253129)
Backed out changeset 93f852ad5d28 (bug 1253129)
This commit is contained in:
Csoregi Natalia 2020-06-29 22:28:56 +03:00
parent b6eec29461
commit 71061cd95b
3 changed files with 5 additions and 89 deletions

View File

@ -288,17 +288,8 @@
"description": "The height in pixels of the new window, including the frame. If not specified defaults to a natural height."
},
"focused": {
"choices": [
{
"type": "boolean",
"enum": [true]
},
{
"type": "boolean",
"enum": [false],
"deprecated": "Opening inactive windows is not supported."
}
],
"unsupported": true,
"type": "boolean",
"optional": true,
"description": "If true, opens an active window. If false, opens an inactive window."
},
@ -332,7 +323,8 @@
"optional": true,
"description": "A string to add to the beginning of the window title."
}
}
},
"optional": true
},
{
"type": "function",

View File

@ -2,12 +2,6 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
const { AddonTestUtils } = ChromeUtils.import(
"resource://testing-common/AddonTestUtils.jsm"
);
AddonTestUtils.initMochitest(this);
// Tests that incompatible parameters can't be used together.
add_task(async function testWindowCreateParams() {
let extension = ExtensionTestUtils.loadExtension({
@ -37,59 +31,3 @@ add_task(async function testWindowCreateParams() {
await extension.awaitFinish("window-create-params");
await extension.unload();
});
// We do not support the focused param, however we do not want
// to fail despite an error when it is passed. This provides
// better code level compatibility with chrome.
add_task(async function testWindowCreateFocused() {
let extension = ExtensionTestUtils.loadExtension({
async background() {
try {
let window = await browser.windows.create({});
browser.test.assertEq(
window.focused,
true,
"window is focused without focused param"
);
await browser.windows.remove(window.id);
window = await browser.windows.create({ focused: true });
browser.test.assertEq(
window.focused,
true,
"window is focused with focused: true"
);
await browser.windows.remove(window.id);
window = await browser.windows.create({ focused: false });
browser.test.assertEq(
window.focused,
true,
"window is focused with focused: false"
);
await browser.windows.remove(window.id);
browser.test.notifyPass("window-create-params");
} catch (e) {
browser.test.fail(`${e} :: ${e.stack}`);
browser.test.notifyFail("window-create-params");
}
},
});
ExtensionTestUtils.failOnSchemaWarnings(false);
let { messages } = await AddonTestUtils.promiseConsoleOutput(async () => {
await extension.startup();
await extension.awaitFinish("window-create-params");
await extension.unload();
});
AddonTestUtils.checkMessages(
messages,
{
expected: [
/Warning processing focused: Opening inactive windows is not supported./,
],
},
"Expected warning processing focused"
);
ExtensionTestUtils.failOnSchemaWarnings(true);
});

View File

@ -516,21 +516,7 @@ class Context {
* @param {Error|string} error
*/
logError(error) {
if (this.cloneScope) {
Cu.reportError(
// Error objects logged using Cu.reportError are not associated
// to the related innerWindowID. This results in a leaked docshell
// since consoleService cannot release the error object when the
// extension global is destroyed.
typeof error == "string" ? error : String(error),
// Report the error with the appropriate stack trace when the
// is related to an actual extension global (instead of being
// related to a manifest validation).
this.principal && ChromeUtils.getCallerLocation(this.principal)
);
} else {
Cu.reportError(error);
}
Cu.reportError(error);
}
/**