1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/netmonitor/test/browser_net_statistics-03.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +/** 1.8 + * Test if the correct filtering predicates are used when filtering from 1.9 + * the performance analysis view. 1.10 + */ 1.11 + 1.12 +function test() { 1.13 + initNetMonitor(FILTERING_URL).then(([aTab, aDebuggee, aMonitor]) => { 1.14 + info("Starting test... "); 1.15 + 1.16 + let panel = aMonitor.panelWin; 1.17 + let { $, EVENTS, NetMonitorView } = panel; 1.18 + 1.19 + EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-html-button")); 1.20 + EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-css-button")); 1.21 + EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-js-button")); 1.22 + EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-other-button")); 1.23 + testFilterButtonsCustom(aMonitor, [0, 1, 1, 1, 0, 0, 0, 0, 0, 1]); 1.24 + ok(true, "The correct filtering predicates are used before entering perf. analysis mode."); 1.25 + 1.26 + promise.all([ 1.27 + waitFor(panel, EVENTS.PRIMED_CACHE_CHART_DISPLAYED), 1.28 + waitFor(panel, EVENTS.EMPTY_CACHE_CHART_DISPLAYED) 1.29 + ]).then(() => { 1.30 + EventUtils.sendMouseEvent({ type: "click" }, $(".pie-chart-slice")); 1.31 + testFilterButtons(aMonitor, "html"); 1.32 + ok(true, "The correct filtering predicate is used when exiting perf. analysis mode."); 1.33 + 1.34 + teardown(aMonitor).then(finish); 1.35 + }); 1.36 + 1.37 + NetMonitorView.toggleFrontendMode(); 1.38 + }); 1.39 +}