tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_popup-record-discard.js (1084B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 add_task(async function test() {
      8  info("Test that the profiler popup recording can be discarded.");
      9  await setProfilerFrontendUrl(
     10    "https://example.com",
     11    "/browser/devtools/client/performance-new/test/browser/fake-frontend.html"
     12  );
     13  await makeSureProfilerPopupIsEnabled();
     14  await withPopupOpen(window, async () => {
     15    {
     16      const button = await getElementByLabel(document, "Start Recording");
     17      info("Click the button to start recording.");
     18      button.click();
     19    }
     20 
     21    {
     22      const button = await getElementByLabel(document, "Discard");
     23      info("Click the button to discard the recording.");
     24      button.click();
     25    }
     26 
     27    {
     28      const button = await getElementByLabel(document, "Start Recording");
     29      ok(
     30        Boolean(button),
     31        "The popup reverted back to be able to start recording again"
     32      );
     33    }
     34  });
     35 });