browser_dbg-editor-exception.js (1077B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ 4 5 // Tests that the editor does not crash when closing a tab (using the contextmenu) 6 7 "use strict"; 8 9 add_task(async function testEditorExceptionClose() { 10 const dbg = await initDebugger("doc-exceptions.html", "exceptions.js"); 11 await selectSource(dbg, "exceptions.js"); 12 is(countTabs(dbg), 1, "Tab for the exceptions.js source is open"); 13 await openActiveTabContextMenuAndSelectCloseTabItem(dbg); 14 is(countTabs(dbg), 0, "All tabs are closed"); 15 }); 16 17 async function openActiveTabContextMenuAndSelectCloseTabItem(dbg) { 18 const waitForOpen = waitForContextMenu(dbg); 19 info(`Open the current active tab context menu`); 20 rightClickElement(dbg, "activeTab"); 21 await waitForOpen; 22 const wait = waitForDispatch(dbg.store, "CLOSE_TABS_FOR_SOURCES"); 23 info(`Select the close tab context menu item`); 24 selectContextMenuItem(dbg, `#node-menu-close-tab`); 25 return wait; 26 }