summaryrefslogtreecommitdiffstats
path: root/devtools/client/netmonitor/test/browser_net_reload-button.js
blob: e91de8302a1c4db7dbe82bf03ea155bd2973c60f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

/**
 * Tests if the empty-requests reload button works.
 */

add_task(function* () {
  let { monitor } = yield initNetMonitor(SINGLE_GET_URL);
  info("Starting test... ");

  let { document, NetMonitorView } = monitor.panelWin;
  let { RequestsMenu } = NetMonitorView;

  let wait = waitForNetworkEvents(monitor, 2);
  let button = document.querySelector("#requests-menu-reload-notice-button");
  button.click();
  yield wait;

  is(RequestsMenu.itemCount, 2, "The request menu should have two items after reloading");

  return teardown(monitor);
});