|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 /** |
|
5 * Test if the correct filtering predicates are used when filtering from |
|
6 * the performance analysis view. |
|
7 */ |
|
8 |
|
9 function test() { |
|
10 initNetMonitor(FILTERING_URL).then(([aTab, aDebuggee, aMonitor]) => { |
|
11 info("Starting test... "); |
|
12 |
|
13 let panel = aMonitor.panelWin; |
|
14 let { $, EVENTS, NetMonitorView } = panel; |
|
15 |
|
16 EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-html-button")); |
|
17 EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-css-button")); |
|
18 EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-js-button")); |
|
19 EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-other-button")); |
|
20 testFilterButtonsCustom(aMonitor, [0, 1, 1, 1, 0, 0, 0, 0, 0, 1]); |
|
21 ok(true, "The correct filtering predicates are used before entering perf. analysis mode."); |
|
22 |
|
23 promise.all([ |
|
24 waitFor(panel, EVENTS.PRIMED_CACHE_CHART_DISPLAYED), |
|
25 waitFor(panel, EVENTS.EMPTY_CACHE_CHART_DISPLAYED) |
|
26 ]).then(() => { |
|
27 EventUtils.sendMouseEvent({ type: "click" }, $(".pie-chart-slice")); |
|
28 testFilterButtons(aMonitor, "html"); |
|
29 ok(true, "The correct filtering predicate is used when exiting perf. analysis mode."); |
|
30 |
|
31 teardown(aMonitor).then(finish); |
|
32 }); |
|
33 |
|
34 NetMonitorView.toggleFrontendMode(); |
|
35 }); |
|
36 } |