summaryrefslogtreecommitdiffstats
path: root/devtools/client/application/test/browser/browser_application_panel_telemetry-select-page.js
blob: c200c38c1709d2ab1643dd53c956fc5b34158c87 (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
26
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

add_task(async function () {
  await enableApplicationPanel();

  const TAB_URL = URL_ROOT + "resources/service-workers/empty.html";
  const { panel, tab, commands } = await openNewTabAndApplicationPanel(TAB_URL);
  const doc = panel.panelWin.document;

  setupTelemetryTest();

  // make sure the default page is opened and then select a different one
  await waitUntil(() => doc.querySelector(".js-service-workers-page") !== null);
  ok(true, "Service Workers page was loaded per default.");
  selectPage(panel, "manifest");

  checkTelemetryEvent({ method: "select_page", page_type: "manifest" });

  // close the tab
  info("Closing the tab.");
  await commands.client.waitForRequestsToSettle();
  await BrowserTestUtils.removeTab(tab);
});