tor-browser

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

browser_popup-record-capture.js (1289B)


      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(
      9    "Test that the profiler pop-up works end to end with profile recording and " +
     10      "capture using the mouse and hitting buttons."
     11  );
     12  await setProfilerFrontendUrl(
     13    "https://example.com",
     14    "/browser/devtools/client/performance-new/test/browser/fake-frontend.html"
     15  );
     16  await makeSureProfilerPopupIsEnabled();
     17  await openPopupAndEnsureCloses(window, async () => {
     18    {
     19      const button = await getElementByLabel(document, "Start Recording");
     20      info("Click the button to start recording.");
     21      button.click();
     22    }
     23 
     24    {
     25      const button = await getElementByLabel(document, "Capture");
     26      info("Click the button to capture the recording.");
     27      button.click();
     28    }
     29 
     30    info(
     31      "If the profiler successfully injects a profile into the page, then the " +
     32        "fake frontend will rename the title of the page."
     33    );
     34 
     35    await checkTabLoadedProfile({
     36      initialTitle: "Waiting on the profile",
     37      successTitle: "Profile received",
     38      errorTitle: "Error",
     39    });
     40  });
     41 });