michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Test if the correct filtering predicates are used when filtering from michael@0: * the performance analysis view. michael@0: */ michael@0: michael@0: function test() { michael@0: initNetMonitor(FILTERING_URL).then(([aTab, aDebuggee, aMonitor]) => { michael@0: info("Starting test... "); michael@0: michael@0: let panel = aMonitor.panelWin; michael@0: let { $, EVENTS, NetMonitorView } = panel; michael@0: michael@0: EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-html-button")); michael@0: EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-css-button")); michael@0: EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-js-button")); michael@0: EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-other-button")); michael@0: testFilterButtonsCustom(aMonitor, [0, 1, 1, 1, 0, 0, 0, 0, 0, 1]); michael@0: ok(true, "The correct filtering predicates are used before entering perf. analysis mode."); michael@0: michael@0: promise.all([ michael@0: waitFor(panel, EVENTS.PRIMED_CACHE_CHART_DISPLAYED), michael@0: waitFor(panel, EVENTS.EMPTY_CACHE_CHART_DISPLAYED) michael@0: ]).then(() => { michael@0: EventUtils.sendMouseEvent({ type: "click" }, $(".pie-chart-slice")); michael@0: testFilterButtons(aMonitor, "html"); michael@0: ok(true, "The correct filtering predicate is used when exiting perf. analysis mode."); michael@0: michael@0: teardown(aMonitor).then(finish); michael@0: }); michael@0: michael@0: NetMonitorView.toggleFrontendMode(); michael@0: }); michael@0: }