tor-browser

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

test_setBreakpoint-on-line-with-multiple-statements.js (1272B)


      1 "use strict";
      2 
      3 const SOURCE_URL = getFileUrl(
      4  "setBreakpoint-on-line-with-multiple-statements.js"
      5 );
      6 
      7 add_task(
      8  threadFrontTest(
      9    async ({ threadFront, debuggee }) => {
     10      const promise = waitForNewSource(threadFront, SOURCE_URL);
     11      loadSubScript(SOURCE_URL, debuggee);
     12      const { source } = await promise;
     13      const sourceFront = threadFront.source(source);
     14 
     15      const location = { sourceUrl: sourceFront.url, line: 4 };
     16      setBreakpoint(threadFront, location);
     17 
     18      const packet = await executeOnNextTickAndWaitForPause(function () {
     19        Cu.evalInSandbox("f()", debuggee);
     20      }, threadFront);
     21      const why = packet.why;
     22      const environment = await packet.frame.getEnvironment();
     23      Assert.equal(why.type, "breakpoint");
     24      Assert.equal(why.actors.length, 1);
     25      const frame = packet.frame;
     26      const where = frame.where;
     27      Assert.equal(where.actor, source.actor);
     28      Assert.equal(where.line, location.line);
     29      const variables = environment.bindings.variables;
     30      Assert.equal(variables.a.value.type, "undefined");
     31      Assert.equal(variables.b.value.type, "undefined");
     32      Assert.equal(variables.c.value.type, "undefined");
     33 
     34      await resume(threadFront);
     35    },
     36    { doNotRunWorker: true }
     37  )
     38 );