browser_net_waterfall-click.js (880B)
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 that clicking on the waterfall opens the timing sidebar panel. 8 */ 9 10 add_task(async function () { 11 const { tab, monitor } = await initNetMonitor( 12 CONTENT_TYPE_WITHOUT_CACHE_URL, 13 { requestCount: 1 } 14 ); 15 const { document } = monitor.panelWin; 16 17 // Execute requests. 18 await performRequests(monitor, tab, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS); 19 20 info("Clicking waterfall and waiting for panel update."); 21 const wait = waitForDOM(document, "#timings-panel"); 22 23 EventUtils.sendMouseEvent( 24 { type: "mousedown" }, 25 document.querySelectorAll(".requests-list-timings")[0] 26 ); 27 28 await wait; 29 30 ok( 31 document.querySelector("#timings-tab[aria-selected=true]"), 32 "Timings tab is selected." 33 ); 34 35 return teardown(monitor); 36 });