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