browser_webconsole_netlogging_panel.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /* vim:set ts=2 sw=2 sts=2 et: */
  2. /* Any copyright is dedicated to the Public Domain.
  3. * http://creativecommons.org/publicdomain/zero/1.0/ */
  4. // Tests that network log messages bring up the network panel.
  5. "use strict";
  6. const TEST_NETWORK_REQUEST_URI =
  7. "http://example.com/browser/devtools/client/webconsole/test/" +
  8. "test-network-request.html";
  9. add_task(function* () {
  10. let finishedRequest = waitForFinishedRequest(({ request }) => {
  11. return request.url.endsWith("test-network-request.html");
  12. });
  13. const hud = yield loadPageAndGetHud(TEST_NETWORK_REQUEST_URI);
  14. let request = yield finishedRequest;
  15. yield hud.ui.openNetworkPanel(request.actor);
  16. let toolbox = gDevTools.getToolbox(hud.target);
  17. is(toolbox.currentToolId, "netmonitor", "Network panel was opened");
  18. let panel = toolbox.getCurrentPanel();
  19. let selected = panel.panelWin.NetMonitorView.RequestsMenu.selectedItem;
  20. is(selected.attachment.method, request.request.method,
  21. "The correct request is selected");
  22. is(selected.attachment.url, request.request.url,
  23. "The correct request is definitely selected");
  24. });