test_setBreakpoint-on-column-in-gcd-script.js (1479B)
1 "use strict"; 2 3 const SOURCE_URL = getFileUrl("setBreakpoint-on-column-in-gcd-script.js"); 4 5 add_task( 6 threadFrontTest( 7 async ({ threadFront, debuggee, targetFront }) => { 8 const promise = waitForNewSource(threadFront, SOURCE_URL); 9 loadSubScriptWithOptions(SOURCE_URL, { 10 target: debuggee, 11 ignoreCache: true, 12 }); 13 Cu.forceGC(); 14 Cu.forceGC(); 15 Cu.forceGC(); 16 17 const { source } = await promise; 18 19 const location = { sourceUrl: source.url, line: 6, column: 21 }; 20 setBreakpoint(threadFront, location); 21 22 const packet = await executeOnNextTickAndWaitForPause(function () { 23 reload(targetFront).then(function () { 24 loadSubScriptWithOptions(SOURCE_URL, { 25 target: debuggee, 26 ignoreCache: true, 27 }); 28 }); 29 }, threadFront); 30 const environment = await packet.frame.getEnvironment(); 31 const why = packet.why; 32 Assert.equal(why.type, "breakpoint"); 33 Assert.equal(why.actors.length, 1); 34 const frame = packet.frame; 35 const where = frame.where; 36 Assert.equal(where.line, location.line); 37 Assert.equal(where.column, location.column); 38 const variables = environment.bindings.variables; 39 Assert.equal(variables.a.value, 1); 40 Assert.equal(variables.b.value.type, "undefined"); 41 Assert.equal(variables.c.value.type, "undefined"); 42 await resume(threadFront); 43 }, 44 { doNotRunWorker: true } 45 ) 46 );