browser_net_open_in_debugger.js (1144B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 /** 7 * Test the 'Open in debugger' feature 8 */ 9 10 add_task(async function () { 11 const { tab, monitor, toolbox } = await initNetMonitor( 12 CONTENT_TYPE_WITHOUT_CACHE_URL, 13 { requestCount: 1 } 14 ); 15 info("Starting test... "); 16 17 const { document, store, windowRequire } = monitor.panelWin; 18 // Avoid async processing 19 const Actions = windowRequire("devtools/client/netmonitor/src/actions/index"); 20 store.dispatch(Actions.batchEnable(false)); 21 22 // Execute requests. 23 await performRequests(monitor, tab, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS); 24 25 EventUtils.sendMouseEvent( 26 { type: "mousedown" }, 27 document.querySelectorAll(".request-list-item")[2] 28 ); 29 EventUtils.sendMouseEvent( 30 { type: "contextmenu" }, 31 document.querySelectorAll(".request-list-item")[2] 32 ); 33 const onDebuggerReady = toolbox.once("jsdebugger-ready"); 34 await selectContextMenuItem(monitor, "request-list-context-open-in-debugger"); 35 await onDebuggerReady; 36 37 ok(true, "Debugger has been open"); 38 39 await teardown(monitor); 40 });