tor-browser

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

test_setBreakpoint-at-the-end-of-a-minified-fn.js (1347B)


      1 "use strict";
      2 
      3 const SOURCE_URL = getFileUrl("setBreakpoint-on-column-minified.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      // Pause inside of the nested function so we can make sure that we don't
     13      // add any other breakpoints at other places on this line.
     14      const location = { sourceUrl: source.url, line: 3, column: 81 };
     15      setBreakpoint(threadFront, location);
     16 
     17      const packet = await executeOnNextTickAndWaitForPause(function () {
     18        Cu.evalInSandbox("f()", debuggee);
     19      }, threadFront);
     20 
     21      const why = packet.why;
     22      Assert.equal(why.type, "breakpoint");
     23      Assert.equal(why.actors.length, 1);
     24 
     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      Assert.equal(where.column, 81);
     30 
     31      const environment = await packet.frame.getEnvironment();
     32      const variables = environment.bindings.variables;
     33      Assert.equal(variables.a.value, 1);
     34      Assert.equal(variables.b.value, 2);
     35      Assert.equal(variables.c.value, 3);
     36 
     37      await resume(threadFront);
     38    },
     39    { doNotRunWorker: true }
     40  )
     41 );