tor-browser

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

browser_dbg-log-events.js (874B)


      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 /*
      6 * Tests that we can log event listeners calls
      7 */
      8 
      9 "use strict";
     10 
     11 add_task(async function () {
     12  Services.prefs.setBoolPref("devtools.toolbox.splitconsole.open", true);
     13  const dbg = await initDebugger(
     14    "doc-event-breakpoints.html",
     15    "event-breakpoints.js"
     16  );
     17 
     18  await clickElement(dbg, "logEventsCheckbox");
     19  await dbg.actions.addEventListenerBreakpoints("breakpoint", [
     20    "event.mouse.click",
     21    "animationframe.request",
     22  ]);
     23  clickElementInTab("#click-target");
     24 
     25  await hasConsoleMessage(dbg, "click { target: div#click-target");
     26  await hasConsoleMessage(dbg, "function rafCallback()");
     27  await waitForRequestsToSettle(dbg);
     28  ok(true);
     29 });