summaryrefslogtreecommitdiffstats
path: root/browser/components/customizableui/test/browser_open_from_popup.js
blob: f89dc8c4f7e5d400f3969b1f24769443ad6716c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"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);
});