browser/devtools/netmonitor/test/browser_net_statistics-03.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * Test if the correct filtering predicates are used when filtering from
     6  * the performance analysis view.
     7  */
     9 function test() {
    10   initNetMonitor(FILTERING_URL).then(([aTab, aDebuggee, aMonitor]) => {
    11     info("Starting test... ");
    13     let panel = aMonitor.panelWin;
    14     let { $, EVENTS, NetMonitorView } = panel;
    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.");
    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.");
    31       teardown(aMonitor).then(finish);
    32     });
    34     NetMonitorView.toggleFrontendMode();
    35   });
    36 }

mercurial