fune/browser/components/customizableui/test/browser_open_from_popup.js
Kris Maglione 94e3b0bd8d Bug 1596918: Part 3a - Scripted rewrite of most ContentTask.spawn calls to SpecialPowers.spawn calls. r=mccr8,remote-protocol-reviewers,ato
This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.

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

--HG--
extra : moz-landing-system : lando
2019-12-13 20:36:16 +00:00

24 lines
759 B
JavaScript

"use strict";
/**
* Check that opening customize mode in a popup opens it in the main window.
*/
add_task(async function open_customize_mode_from_popup() {
let promiseWindow = BrowserTestUtils.waitForNewWindow();
SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
content.window.open("about:blank", "_blank", "height=300,toolbar=no");
});
let win = await promiseWindow;
let customizePromise = BrowserTestUtils.waitForEvent(
gNavToolbox,
"customizationready"
);
win.gCustomizeMode.enter();
await customizePromise;
ok(
document.documentElement.hasAttribute("customizing"),
"Should have opened customize mode in the parent window"
);
await endCustomizing();
await BrowserTestUtils.closeWindow(win);
});