browser_open_from_popup.js (760B)
1 "use strict"; 2 3 /** 4 * Check that opening customize mode in a popup opens it in the main window. 5 */ 6 add_task(async function open_customize_mode_from_popup() { 7 let promiseWindow = BrowserTestUtils.waitForNewWindow(); 8 SpecialPowers.spawn(gBrowser.selectedBrowser, [], function () { 9 content.window.open("about:blank", "_blank", "height=300,toolbar=no"); 10 }); 11 let win = await promiseWindow; 12 let customizePromise = BrowserTestUtils.waitForEvent( 13 gNavToolbox, 14 "customizationready" 15 ); 16 win.gCustomizeMode.enter(); 17 await customizePromise; 18 ok( 19 document.documentElement.hasAttribute("customizing"), 20 "Should have opened customize mode in the parent window" 21 ); 22 await endCustomizing(); 23 await BrowserTestUtils.closeWindow(win); 24 });