tor-browser

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

test_setBreakpoint-on-column.js (1234B)


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