fune/browser/components/customizableui/test/browser_open_from_popup.js
Gijs Kruitbosch d0f97efd43 Bug 1390260 - remove old customize test, add test that checks it works in main window, r=mkaply
MozReview-Commit-ID: 9Tm8kLjxukB

--HG--
extra : rebase_source : a8d599d6e67151abdc2b65297b5cb5fcbc2dbea7
2017-08-15 17:42:16 +01:00

19 lines
744 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(true);
ContentTask.spawn(gBrowser.selectedBrowser, null, 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);
});