tor-browser

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

test_frameactor-01.js (738B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 /**
      7 * Verify that we get a frame actor along with a debugger statement.
      8 */
      9 
     10 add_task(
     11  threadFrontTest(async ({ threadFront, debuggee }) => {
     12    const packet = await executeOnNextTickAndWaitForPause(
     13      () => evalCode(debuggee),
     14      threadFront
     15    );
     16 
     17    Assert.ok(!!packet.frame);
     18    Assert.ok(!!packet.frame.getActorByID);
     19    Assert.equal(packet.frame.displayName, "stopMe");
     20    await threadFront.resume();
     21  })
     22 );
     23 
     24 function evalCode(debuggee) {
     25  debuggee.eval(
     26    "(" +
     27      function () {
     28        function stopMe() {
     29          debugger;
     30        }
     31        stopMe();
     32      } +
     33      ")()"
     34  );
     35 }