browser_exit_background_customize_mode.js (1305B)
1 "use strict"; 2 3 /** 4 * Tests that if customize mode is currently attached to a background 5 * tab, and that tab browses to a new location, that customize mode 6 * is detached from that tab. 7 */ 8 add_task(async function test_exit_background_customize_mode() { 9 let nonCustomizingTab = gBrowser.selectedTab; 10 11 Assert.equal( 12 gBrowser.tabContainer.querySelector("tab[customizemode=true]"), 13 null, 14 "Should not have a tab marked as being the customize tab now." 15 ); 16 17 await startCustomizing(); 18 is(gBrowser.tabs.length, 2, "Should have 2 tabs"); 19 20 let custTab = gBrowser.selectedTab; 21 22 let finishedCustomizing = BrowserTestUtils.waitForEvent( 23 gNavToolbox, 24 "aftercustomization" 25 ); 26 await BrowserTestUtils.switchTab(gBrowser, nonCustomizingTab); 27 await finishedCustomizing; 28 29 let newURL = "http://example.com/"; 30 BrowserTestUtils.startLoadingURIString(custTab.linkedBrowser, newURL); 31 await BrowserTestUtils.browserLoaded(custTab.linkedBrowser, false, newURL); 32 33 Assert.equal( 34 gBrowser.tabContainer.querySelector("tab[customizemode=true]"), 35 null, 36 "Should not have a tab marked as being the customize tab now." 37 ); 38 39 await startCustomizing(); 40 is(gBrowser.tabs.length, 3, "Should have 3 tabs now"); 41 42 await endCustomizing(); 43 BrowserTestUtils.removeTab(custTab); 44 });