tor-browser

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

test_pauselifetime-04.js (991B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 /**
      7 * Test that requesting a pause actor for the same value multiple
      8 * times returns the same actor.
      9 */
     10 
     11 add_task(
     12  threadFrontTest(async ({ threadFront, debuggee }) => {
     13    const packet = await executeOnNextTickAndWaitForPause(
     14      () => evaluateTestCode(debuggee),
     15      threadFront
     16    );
     17 
     18    const args = packet.frame.arguments;
     19    const objActor1 = args[0].actor;
     20 
     21    const response = await threadFront.getFrames(0, 1);
     22    const frame = response.frames[0];
     23    Assert.equal(objActor1, frame.arguments[0].actor);
     24 
     25    await threadFront.resume();
     26  })
     27 );
     28 
     29 function evaluateTestCode(debuggee) {
     30  debuggee.eval(
     31    "(" +
     32      function () {
     33        // These arguments are tested.
     34        // eslint-disable-next-line no-unused-vars
     35        function stopMe(obj) {
     36          debugger;
     37        }
     38        stopMe({ foo: "bar" });
     39      } +
     40      ")()"
     41  );
     42 }