Commit 6f448efb authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[inspector] Make wasm tests fail rather than time out.

Consistently use InspectorTest.runAsyncTestSuite() in wasm inspector
tests to make tests easier to debug (they'll fail instead of timing
out in case of errors).

Bug: chromium:1162229, chromium:1071432
Change-Id: I7aada196f9e34071aa1bb059bb45f85f75226060
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2609414
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71908}
parent afd3f63e
Test that breakpoints do not survive a restart of the debugger. Test that breakpoints do not survive a restart of the debugger.
Running test: test
Instantiating. Instantiating.
Waiting for wasm script (ignoring first non-wasm script). Waiting for wasm script (ignoring first non-wasm script).
Setting breakpoint. Setting breakpoint.
...@@ -8,4 +10,3 @@ func returned. ...@@ -8,4 +10,3 @@ func returned.
Restarting debugger. Restarting debugger.
Calling func. Calling func.
func returned. func returned.
Finished.
...@@ -9,10 +9,8 @@ const {session, contextGroup, Protocol} = InspectorTest.start( ...@@ -9,10 +9,8 @@ const {session, contextGroup, Protocol} = InspectorTest.start(
session.setupScriptMap(); session.setupScriptMap();
const builder = new WasmModuleBuilder(); const builder = new WasmModuleBuilder();
const func = const func =
builder.addFunction('func', kSig_v_v).addBody([kExprNop]).exportFunc(); builder.addFunction('func', kSig_v_v).addBody([kExprNop]).exportFunc();
const module_bytes = builder.toArray(); const module_bytes = builder.toArray();
Protocol.Debugger.onPaused(async msg => { Protocol.Debugger.onPaused(async msg => {
...@@ -20,7 +18,8 @@ Protocol.Debugger.onPaused(async msg => { ...@@ -20,7 +18,8 @@ Protocol.Debugger.onPaused(async msg => {
Protocol.Debugger.resume(); Protocol.Debugger.resume();
}); });
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Instantiating.'); InspectorTest.log('Instantiating.');
// Spawn asynchronously: // Spawn asynchronously:
...@@ -45,6 +44,5 @@ Protocol.Debugger.onPaused(async msg => { ...@@ -45,6 +44,5 @@ Protocol.Debugger.onPaused(async msg => {
await Protocol.Debugger.disable(); await Protocol.Debugger.disable();
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
} }
InspectorTest.log('Finished.'); }
InspectorTest.completeTest(); ]);
})();
Tests debug command for wasm Tests debug command for wasm
Running test: test
Waiting for wasm scripts to be parsed. Waiting for wasm scripts to be parsed.
Ignoring script with url v8://test/instantiate Ignoring script with url v8://test/instantiate
Got wasm script: wasm://wasm/7d022e0e Got wasm script: wasm://wasm/7d022e0e
...@@ -6,4 +8,3 @@ paused No 1 ...@@ -6,4 +8,3 @@ paused No 1
Script wasm://wasm/7d022e0e byte offset 35: Wasm opcode 0x20 (kExprLocalGet) Script wasm://wasm/7d022e0e byte offset 35: Wasm opcode 0x20 (kExprLocalGet)
Debugger.resume Debugger.resume
exports.main returned! exports.main returned!
Finished!
...@@ -43,7 +43,8 @@ function test() { ...@@ -43,7 +43,8 @@ function test() {
} }
//# sourceURL=test.js`); //# sourceURL=test.js`);
(async function Test() { InspectorTest.runAsyncTestSuite([
async function test() {
breakCount = 0; breakCount = 0;
breakpointId = 0; breakpointId = 0;
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
...@@ -51,9 +52,8 @@ function test() { ...@@ -51,9 +52,8 @@ function test() {
await waitForWasmScript(); await waitForWasmScript();
await Protocol.Runtime.evaluate({ expression: 'test()', includeCommandLineAPI: true}); await Protocol.Runtime.evaluate({ expression: 'test()', includeCommandLineAPI: true});
InspectorTest.log('exports.main returned!'); InspectorTest.log('exports.main returned!');
InspectorTest.log('Finished!'); }
InspectorTest.completeTest(); ]);
})();
function printFailure(message) { function printFailure(message) {
if (!message.result) { if (!message.result) {
......
...@@ -9,8 +9,8 @@ utils.load('test/inspector/wasm-inspector-test.js'); ...@@ -9,8 +9,8 @@ utils.load('test/inspector/wasm-inspector-test.js');
let {session, contextGroup, Protocol} = let {session, contextGroup, Protocol} =
InspectorTest.start('Test wasm scope information with externref globals'); InspectorTest.start('Test wasm scope information with externref globals');
(async function() { InspectorTest.runAsyncTestSuite([
try { async function test() {
let builder = new WasmModuleBuilder(); let builder = new WasmModuleBuilder();
builder.addImportedGlobal('m', 'global', kWasmExternRef, false); builder.addImportedGlobal('m', 'global', kWasmExternRef, false);
let func = builder.addFunction('func', kSig_v_v) let func = builder.addFunction('func', kSig_v_v)
...@@ -74,11 +74,5 @@ let {session, contextGroup, Protocol} = ...@@ -74,11 +74,5 @@ let {session, contextGroup, Protocol} =
InspectorTest.log(` ${prop.name}: {${values}}`); InspectorTest.log(` ${prop.name}: {${values}}`);
} }
} }
InspectorTest.log('Finished.');
} catch (exc) {
InspectorTest.log(`Failed with exception: ${exc}.`);
} finally {
InspectorTest.completeTest();
} }
})(); ]);
Tests breakable locations in wasm Tests breakable locations in wasm
Running test: test
Running testFunction... Running testFunction...
Script nr 0 parsed. URL: v8://test/instantiate Script nr 0 parsed. URL: v8://test/instantiate
Script nr 1 parsed. URL: wasm://wasm/354ada0e Script nr 1 parsed. URL: wasm://wasm/354ada0e
...@@ -73,4 +75,3 @@ Stopped at wasm://wasm/354ada0e:0:57 ...@@ -73,4 +75,3 @@ Stopped at wasm://wasm/354ada0e:0:57
Missing breakpoints: 1 Missing breakpoints: 1
Stopped at wasm://wasm/354ada0e:0:58 Stopped at wasm://wasm/354ada0e:0:58
Missing breakpoints: 0 Missing breakpoints: 0
Finished!
...@@ -35,7 +35,8 @@ var module_bytes = builder.toArray(); ...@@ -35,7 +35,8 @@ var module_bytes = builder.toArray();
Protocol.Debugger.enable(); Protocol.Debugger.enable();
Protocol.Debugger.onScriptParsed(handleScriptParsed); Protocol.Debugger.onScriptParsed(handleScriptParsed);
async function runTest() { InspectorTest.runAsyncTestSuite([
async function test() {
InspectorTest.log('Running testFunction...'); InspectorTest.log('Running testFunction...');
await WasmInspectorTest.instantiate(module_bytes); await WasmInspectorTest.instantiate(module_bytes);
await getBreakableLocationsForAllWasmScripts(); await getBreakableLocationsForAllWasmScripts();
...@@ -46,12 +47,8 @@ async function runTest() { ...@@ -46,12 +47,8 @@ async function runTest() {
await waitForAllPauses(); await waitForAllPauses();
// Code should now complete // Code should now complete
await promise; await promise;
InspectorTest.log('Finished!'); }
} ]);
runTest()
.catch(reason => InspectorTest.log(`Failed: ${reason}`))
.then(InspectorTest.completeTest);
var allBreakableLocations = []; var allBreakableLocations = [];
......
Test wasm global names Test wasm global names
Running test: test
Waiting for wasm script to be parsed. Waiting for wasm script to be parsed.
Setting breakpoint in wasm. Setting breakpoint in wasm.
Running main. Running main.
Paused in debugger. Paused in debugger.
globals: {"module_name.imported_global", "exported_global", "global2"} globals: {"module_name.imported_global", "exported_global", "global2"}
Finished.
...@@ -17,23 +17,13 @@ let func = builder.addFunction('func', kSig_v_i) ...@@ -17,23 +17,13 @@ let func = builder.addFunction('func', kSig_v_i)
.exportAs('main'); .exportAs('main');
var o = builder.addGlobal(kWasmI32, func).exportAs('exported_global'); var o = builder.addGlobal(kWasmI32, func).exportAs('exported_global');
builder.addGlobal(kWasmI32); // global2 builder.addGlobal(kWasmI32); // global2
let moduleBytes = JSON.stringify(builder.toArray()); let moduleBytes = builder.toArray();
function test(moduleBytes) { InspectorTest.runAsyncTestSuite([
let module = new WebAssembly.Module((new Uint8Array(moduleBytes)).buffer); async function test() {
let imported_global_value = 123;
instance = new WebAssembly.Instance(
module, {module_name: {imported_global: imported_global_value}});
}
(async function() {
try {
Protocol.Debugger.enable(); Protocol.Debugger.enable();
Protocol.Runtime.evaluate({ Protocol.Runtime.evaluate({
expression: ` expression: `var instance = (${WasmInspectorTest.instantiateFromBuffer})(${JSON.stringify(moduleBytes)}, {module_name: {imported_global: 123}});`
let instance;
${test.toString()}
test(${moduleBytes});`
}); });
InspectorTest.log('Waiting for wasm script to be parsed.'); InspectorTest.log('Waiting for wasm script to be parsed.');
...@@ -72,11 +62,5 @@ function test(moduleBytes) { ...@@ -72,11 +62,5 @@ function test(moduleBytes) {
InspectorTest.log(` ${prop.name}: {${values}}`); InspectorTest.log(` ${prop.name}: {${values}}`);
} }
} }
InspectorTest.log('Finished.');
} catch (exc) {
InspectorTest.log(`Failed with exception: ${exc}.`);
} finally {
InspectorTest.completeTest();
} }
})(); ]);
Test inspecting register values in Liftoff. Test inspecting register values in Liftoff.
Running test: test
Testing i32. Testing i32.
Waiting for wasm script. Waiting for wasm script.
Setting 20 breakpoints. Setting 20 breakpoints.
...@@ -99,4 +101,3 @@ Paused at offset 75; wasm-expression-stack: [0, 1, 44]; local: [0, 1, 2, 3, 4, 5 ...@@ -99,4 +101,3 @@ Paused at offset 75; wasm-expression-stack: [0, 1, 44]; local: [0, 1, 2, 3, 4, 5
Paused at offset 76; wasm-expression-stack: [0, 45]; local: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Paused at offset 76; wasm-expression-stack: [0, 45]; local: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Paused at offset 77; wasm-expression-stack: [45]; local: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Paused at offset 77; wasm-expression-stack: [45]; local: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
main returned. main returned.
Finished!
...@@ -88,11 +88,11 @@ async function testConfig(config) { ...@@ -88,11 +88,11 @@ async function testConfig(config) {
InspectorTest.log('main returned.'); InspectorTest.log('main returned.');
} }
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
for (let config in configs) { for (let config in configs) {
await testConfig(config); await testConfig(config);
} }
InspectorTest.log('Finished!'); }
InspectorTest.completeTest(); ]);
})();
Test wasm memory names Test wasm memory names
Running test: test
Waiting for wasm script to be parsed. Waiting for wasm script to be parsed.
Setting breakpoint in wasm. Setting breakpoint in wasm.
Running main. Running main.
......
...@@ -102,17 +102,11 @@ contextGroup.addScript(` ...@@ -102,17 +102,11 @@ contextGroup.addScript(`
let instance; let instance;
${createInstance.toString()}`); ${createInstance.toString()}`);
(async function test() { InspectorTest.runAsyncTestSuite([
try { async function test() {
Protocol.Debugger.enable(); Protocol.Debugger.enable();
await check(createModuleBytesUnnamedMemory()); await check(createModuleBytesUnnamedMemory());
await check(createModuleBytesExportedMemory()); await check(createModuleBytesExportedMemory());
await check(createModuleBytesImportedMemory()); await check(createModuleBytesImportedMemory());
} catch (exc) {
InspectorTest.log(`Failed with exception: ${exc}.`);
} finally {
InspectorTest.completeTest();
} }
})(); ]);
Regress 10957 Regress 10957
Running test: testRegress10957
Instantiate Instantiate
Finished!
7 7
...@@ -53,7 +53,8 @@ function instantiate(bytes, imports) { ...@@ -53,7 +53,8 @@ function instantiate(bytes, imports) {
return new WebAssembly.Instance(module, imports); return new WebAssembly.Instance(module, imports);
} }
(async function Regress10957() { InspectorTest.runAsyncTestSuite([
async function testRegress10957() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Instantiate'); InspectorTest.log('Instantiate');
const code = const code =
...@@ -64,7 +65,5 @@ function instantiate(bytes, imports) { ...@@ -64,7 +65,5 @@ function instantiate(bytes, imports) {
InspectorTest.logMessage(message.result.result.value)); InspectorTest.logMessage(message.result.result.value));
await Protocol.Debugger.oncePaused(); await Protocol.Debugger.oncePaused();
Protocol.Debugger.resume(); Protocol.Debugger.resume();
}
InspectorTest.log('Finished!'); ]);
InspectorTest.completeTest();
})();
Tests remove breakpoint from wasm scripts. Tests remove breakpoint from wasm scripts.
Running test: Test
Calling instantiate function. Calling instantiate function.
Waiting for wasm scripts to be parsed. Waiting for wasm scripts to be parsed.
Ignoring script with url v8://test/instantiate Ignoring script with url v8://test/instantiate
...@@ -14,4 +16,3 @@ Script wasm://wasm/7d022e0e byte offset 39: Wasm opcode 0x6b (kExprI32Sub) ...@@ -14,4 +16,3 @@ Script wasm://wasm/7d022e0e byte offset 39: Wasm opcode 0x6b (kExprI32Sub)
Remove breakpoint Remove breakpoint
Debugger.resume Debugger.resume
exports.main returned! exports.main returned!
Finished!
...@@ -46,7 +46,8 @@ function test() { ...@@ -46,7 +46,8 @@ function test() {
} }
//# sourceURL=test.js`); //# sourceURL=test.js`);
(async function Test() { InspectorTest.runAsyncTestSuite([
async function Test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Calling instantiate function.'); InspectorTest.log('Calling instantiate function.');
WasmInspectorTest.instantiate(module_bytes); WasmInspectorTest.instantiate(module_bytes);
...@@ -61,9 +62,8 @@ function test() { ...@@ -61,9 +62,8 @@ function test() {
await Protocol.Runtime.evaluate({ expression: 'test()' }); await Protocol.Runtime.evaluate({ expression: 'test()' });
await Protocol.Runtime.evaluate({ expression: 'test()' }); await Protocol.Runtime.evaluate({ expression: 'test()' });
InspectorTest.log('exports.main returned!'); InspectorTest.log('exports.main returned!');
InspectorTest.log('Finished!'); }
InspectorTest.completeTest(); ]);
})();
function printFailure(message) { function printFailure(message) {
if (!message.result) { if (!message.result) {
......
Checks resetting context group with wasm. Checks resetting context group with wasm.
Running test: test
{ {
id : <messageId> id : <messageId>
result : { result : {
......
...@@ -30,7 +30,8 @@ let contextGroup2 = new InspectorTest.ContextGroup(); ...@@ -30,7 +30,8 @@ let contextGroup2 = new InspectorTest.ContextGroup();
let session2 = contextGroup2.connect(); let session2 = contextGroup2.connect();
session2.setupScriptMap(); session2.setupScriptMap();
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
await session1.Protocol.Debugger.enable(); await session1.Protocol.Debugger.enable();
await session2.Protocol.Debugger.enable(); await session2.Protocol.Debugger.enable();
...@@ -45,6 +46,5 @@ session2.setupScriptMap(); ...@@ -45,6 +46,5 @@ session2.setupScriptMap();
await session1.Protocol.Debugger.onceScriptParsed(2); await session1.Protocol.Debugger.onceScriptParsed(2);
InspectorTest.logMessage(await session1.Protocol.Runtime.evaluate({expression: 'instance.exports.main(4)'})); InspectorTest.logMessage(await session1.Protocol.Runtime.evaluate({expression: 'instance.exports.main(4)'}));
InspectorTest.logMessage(await session2.Protocol.Runtime.evaluate({expression: 'instance.exports.main(5)'})); InspectorTest.logMessage(await session2.Protocol.Runtime.evaluate({expression: 'instance.exports.main(5)'}));
}
InspectorTest.completeTest(); ]);
})();
Test retrieving scope information when pausing in wasm functions Test retrieving scope information when pausing in wasm functions
Running test: test
Calling instantiate function. Calling instantiate function.
Waiting for wasm script to be parsed. Waiting for wasm script to be parsed.
Got wasm script! Got wasm script!
......
Test retrieving scope information from compiled Liftoff frames Test retrieving scope information from compiled Liftoff frames
Running test: test
Calling instantiate function. Calling instantiate function.
Waiting for wasm script to be parsed. Waiting for wasm script to be parsed.
Got wasm script! Got wasm script!
......
...@@ -16,7 +16,8 @@ Protocol.Debugger.onPaused(printPauseLocationsAndContinue); ...@@ -16,7 +16,8 @@ Protocol.Debugger.onPaused(printPauseLocationsAndContinue);
let breakpointLocation = -1; let breakpointLocation = -1;
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
// Instantiate wasm and wait for three wasm scripts for the three functions. // Instantiate wasm and wait for three wasm scripts for the three functions.
instantiateWasm(); instantiateWasm();
let scriptIds = await waitForWasmScripts(); let scriptIds = await waitForWasmScripts();
...@@ -32,8 +33,8 @@ let breakpointLocation = -1; ...@@ -32,8 +33,8 @@ let breakpointLocation = -1;
// Now run the wasm code. // Now run the wasm code.
await WasmInspectorTest.evalWithUrl('instance.exports.main(42)', 'runWasm'); await WasmInspectorTest.evalWithUrl('instance.exports.main(42)', 'runWasm');
InspectorTest.log('exports.main returned. Test finished.'); InspectorTest.log('exports.main returned. Test finished.');
InspectorTest.completeTest(); }
})(); ]);
async function printPauseLocationsAndContinue(msg) { async function printPauseLocationsAndContinue(msg) {
let loc = msg.params.callFrames[0].location; let loc = msg.params.callFrames[0].location;
......
...@@ -16,7 +16,8 @@ Protocol.Debugger.onPaused(printPauseLocationsAndContinue); ...@@ -16,7 +16,8 @@ Protocol.Debugger.onPaused(printPauseLocationsAndContinue);
let breakpointLocation = undefined; // Will be set by {instantiateWasm}. let breakpointLocation = undefined; // Will be set by {instantiateWasm}.
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
// Instantiate wasm and wait for three wasm scripts for the three functions. // Instantiate wasm and wait for three wasm scripts for the three functions.
instantiateWasm(); instantiateWasm();
let scriptIds = await waitForWasmScripts(); let scriptIds = await waitForWasmScripts();
...@@ -37,8 +38,8 @@ let breakpointLocation = undefined; // Will be set by {instantiateWasm}. ...@@ -37,8 +38,8 @@ let breakpointLocation = undefined; // Will be set by {instantiateWasm}.
// Now run the wasm code. // Now run the wasm code.
await WasmInspectorTest.evalWithUrl('instance.exports.main(4)', 'runWasm'); await WasmInspectorTest.evalWithUrl('instance.exports.main(4)', 'runWasm');
InspectorTest.log('exports.main returned. Test finished.'); InspectorTest.log('exports.main returned. Test finished.');
InspectorTest.completeTest(); }
})(); ]);
async function printPauseLocationsAndContinue(msg) { async function printPauseLocationsAndContinue(msg) {
let loc = msg.params.callFrames[0].location; let loc = msg.params.callFrames[0].location;
......
Tests reported code offsets on wasm scripts Tests reported code offsets on wasm scripts
Running test: test
Wasm script parsed: ID 0, startColumn: 0, endColumn: 29, codeOffset: 0 Wasm script parsed: ID 0, startColumn: 0, endColumn: 29, codeOffset: 0
Wasm script parsed: ID 1, startColumn: 0, endColumn: 29, codeOffset: 0 Wasm script parsed: ID 1, startColumn: 0, endColumn: 29, codeOffset: 0
Wasm script parsed: ID 2, startColumn: 0, endColumn: 32, codeOffset: 31 Wasm script parsed: ID 2, startColumn: 0, endColumn: 32, codeOffset: 31
......
Tests reported code offsets on wasm scripts Tests reported code offsets on wasm scripts
Running test: test
Wasm script parsed: ID 0, startColumn: 0, endColumn: 29, codeOffset: 0 Wasm script parsed: ID 0, startColumn: 0, endColumn: 29, codeOffset: 0
Wasm script parsed: ID 1, startColumn: 0, endColumn: 29, codeOffset: 0 Wasm script parsed: ID 1, startColumn: 0, endColumn: 29, codeOffset: 0
Wasm script parsed: ID 2, startColumn: 0, endColumn: 32, codeOffset: 31 Wasm script parsed: ID 2, startColumn: 0, endColumn: 32, codeOffset: 31
......
...@@ -109,7 +109,8 @@ function compileAsync(bytes) { ...@@ -109,7 +109,8 @@ function compileAsync(bytes) {
contextGroup.addScript( contextGroup.addScript(
`${compileSync}${compileAsync}`, 0, 0, 'v8://test/compileFunctions'); `${compileSync}${compileAsync}`, 0, 0, 'v8://test/compileFunctions');
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
Protocol.Debugger.enable(); Protocol.Debugger.enable();
let script_ids = new Map(); let script_ids = new Map();
let generators = [ let generators = [
...@@ -140,6 +141,5 @@ contextGroup.addScript( ...@@ -140,6 +141,5 @@ contextGroup.addScript(
++wasm_scripts; ++wasm_scripts;
} }
} }
}
InspectorTest.completeTest(); ]);
})();
...@@ -107,7 +107,8 @@ function compileAsync(bytes) { ...@@ -107,7 +107,8 @@ function compileAsync(bytes) {
contextGroup.addScript( contextGroup.addScript(
`${compileSync}${compileAsync}`, 0, 0, 'v8://test/compileFunctions'); `${compileSync}${compileAsync}`, 0, 0, 'v8://test/compileFunctions');
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
Protocol.Debugger.enable(); Protocol.Debugger.enable();
let script_ids = new Map(); let script_ids = new Map();
let generators = [ let generators = [
...@@ -138,6 +139,5 @@ contextGroup.addScript( ...@@ -138,6 +139,5 @@ contextGroup.addScript(
++wasm_scripts; ++wasm_scripts;
} }
} }
}
InspectorTest.completeTest(); ]);
})();
Tests if breakpoint set is first breakable location Tests if breakpoint set is first breakable location
Running test: test
Running test function... Running test function...
Set breakpoint outside of any function: (0, 0). Set breakpoint outside of any function: (0, 0).
Setting breakpoint for id: 4 at 0, 0. Setting breakpoint for id: 4 at 0, 0.
...@@ -18,4 +20,3 @@ Set breakpoint at non-breakable location: (0, 42). ...@@ -18,4 +20,3 @@ Set breakpoint at non-breakable location: (0, 42).
Setting breakpoint for id: 4 at 0, 42. Setting breakpoint for id: 4 at 0, 42.
Location match for (0, 43). Location match for (0, 43).
Initial location is expected to be breakable: false. Initial location is expected to be breakable: false.
Finished!
\ No newline at end of file
...@@ -32,17 +32,14 @@ builder.addFunction('main', kSig_v_i) ...@@ -32,17 +32,14 @@ builder.addFunction('main', kSig_v_i)
var module_bytes = builder.toArray(); var module_bytes = builder.toArray();
Protocol.Debugger.enable(); Protocol.Debugger.enable();
runTest() InspectorTest.runAsyncTestSuite([
.catch(reason => InspectorTest.log(`Failed: ${reason}.`)) async function test() {
.then(InspectorTest.completeTest);
async function runTest() {
InspectorTest.log('Running test function...'); InspectorTest.log('Running test function...');
WasmInspectorTest.instantiate(module_bytes); WasmInspectorTest.instantiate(module_bytes);
const [, {params: wasmScript}] = await Protocol.Debugger.onceScriptParsed(2); const [, {params: wasmScript}] = await Protocol.Debugger.onceScriptParsed(2);
await checkSetBreakpointForScript(wasmScript.scriptId); await checkSetBreakpointForScript(wasmScript.scriptId);
InspectorTest.log('Finished!'); }
} ]);
function printFailure(message) { function printFailure(message) {
if (!message.result) { if (!message.result) {
......
Tests stepping through wasm scripts. Tests stepping through wasm scripts.
Running test: test
Instantiating. Instantiating.
Waiting for wasm script (ignoring first non-wasm script). Waiting for wasm script (ignoring first non-wasm script).
Setting breakpoint at offset 54 on script wasm://wasm/0c10a5fe Setting breakpoint at offset 54 on script wasm://wasm/0c10a5fe
...@@ -35,4 +37,3 @@ Breaking on byte offset 54 ...@@ -35,4 +37,3 @@ Breaking on byte offset 54
Breaking on byte offset 45 Breaking on byte offset 45
Breaking on byte offset 47 Breaking on byte offset 47
exports.main returned! exports.main returned!
Finished!
Tests stepping through wasm scripts. Tests stepping through wasm scripts.
Running test: test
Instantiating. Instantiating.
Waiting for wasm script (ignoring first non-wasm script). Waiting for wasm script (ignoring first non-wasm script).
Setting breakpoint at offset 38 on script wasm://wasm/0c10a5fe Setting breakpoint at offset 38 on script wasm://wasm/0c10a5fe
...@@ -425,4 +427,3 @@ at wasm_B (0:61): ...@@ -425,4 +427,3 @@ at wasm_B (0:61):
at (anonymous) (0:17): at (anonymous) (0:17):
-- skipped -- skipped
exports.main returned! exports.main returned!
Finished!
...@@ -84,7 +84,8 @@ Protocol.Debugger.onPaused(async msg => { ...@@ -84,7 +84,8 @@ Protocol.Debugger.onPaused(async msg => {
Protocol.Debugger.resume(); Protocol.Debugger.resume();
}); });
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Instantiating.'); InspectorTest.log('Instantiating.');
// Spawn asynchronously: // Spawn asynchronously:
...@@ -99,6 +100,5 @@ Protocol.Debugger.onPaused(async msg => { ...@@ -99,6 +100,5 @@ Protocol.Debugger.onPaused(async msg => {
InspectorTest.log('Calling main(4)'); InspectorTest.log('Calling main(4)');
await WasmInspectorTest.evalWithUrl('instance.exports.main(4)', 'runWasm'); await WasmInspectorTest.evalWithUrl('instance.exports.main(4)', 'runWasm');
InspectorTest.log('exports.main returned!'); InspectorTest.log('exports.main returned!');
InspectorTest.log('Finished!'); }
InspectorTest.completeTest(); ]);
})();
...@@ -53,7 +53,8 @@ Protocol.Debugger.onPaused(pause_msg => { ...@@ -53,7 +53,8 @@ Protocol.Debugger.onPaused(pause_msg => {
Protocol.Debugger.resume(); Protocol.Debugger.resume();
}); });
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Instantiating.'); InspectorTest.log('Instantiating.');
// Spawn asynchronously: // Spawn asynchronously:
...@@ -68,6 +69,5 @@ Protocol.Debugger.onPaused(pause_msg => { ...@@ -68,6 +69,5 @@ Protocol.Debugger.onPaused(pause_msg => {
InspectorTest.log('Calling main(4)'); InspectorTest.log('Calling main(4)');
await WasmInspectorTest.evalWithUrl('instance.exports.main(4)', 'runWasm'); await WasmInspectorTest.evalWithUrl('instance.exports.main(4)', 'runWasm');
InspectorTest.log('exports.main returned!'); InspectorTest.log('exports.main returned!');
InspectorTest.log('Finished!'); }
InspectorTest.completeTest(); ]);
})();
Tests pausing a running script and stepping Tests pausing a running script and stepping
Running test: testPauseAndStep
Instantiate Instantiate
Wait for script Wait for script
Got wasm script: wasm://wasm/c84b7cde Got wasm script: wasm://wasm/c84b7cde
...@@ -9,4 +11,3 @@ Paused at offset 62; wasm-expression-stack: []; local: [12] ...@@ -9,4 +11,3 @@ Paused at offset 62; wasm-expression-stack: []; local: [12]
Paused at offset 64; wasm-expression-stack: [12]; local: [12] Paused at offset 64; wasm-expression-stack: [12]; local: [12]
Paused at offset 66; wasm-expression-stack: [12, 1]; local: [12] Paused at offset 66; wasm-expression-stack: [12, 1]; local: [12]
Paused at offset 67; wasm-expression-stack: [13]; local: [12] Paused at offset 67; wasm-expression-stack: [13]; local: [12]
Finished!
...@@ -35,7 +35,8 @@ function instantiate(bytes, imports) { ...@@ -35,7 +35,8 @@ function instantiate(bytes, imports) {
return new WebAssembly.Instance(module, imports); return new WebAssembly.Instance(module, imports);
} }
(async function pauseAndStep() { InspectorTest.runAsyncTestSuite([
async function testPauseAndStep() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Instantiate'); InspectorTest.log('Instantiate');
const instantiate_code = `var instance = (${instantiate})(${JSON.stringify(module_bytes)}, {'imports': {'pause': () => { %ScheduleBreak() } }});`; const instantiate_code = `var instance = (${instantiate})(${JSON.stringify(module_bytes)}, {'imports': {'pause': () => { %ScheduleBreak() } }});`;
...@@ -52,9 +53,8 @@ function instantiate(bytes, imports) { ...@@ -52,9 +53,8 @@ function instantiate(bytes, imports) {
await waitForPauseAndStep('stepInto'); await waitForPauseAndStep('stepInto');
await waitForPauseAndStep('stepInto'); await waitForPauseAndStep('stepInto');
await waitForPauseAndStep('resume'); await waitForPauseAndStep('resume');
InspectorTest.log('Finished!'); }
InspectorTest.completeTest(); ]);
})();
async function waitForPauseAndStep(stepAction) { async function waitForPauseAndStep(stepAction) {
const msg = await Protocol.Debugger.oncePaused(); const msg = await Protocol.Debugger.oncePaused();
......
Test scope inspection and stepping after a trap. Test scope inspection and stepping after a trap.
Running test: test
Instantiating. Instantiating.
Calling div function. Calling div function.
Paused at: Paused at:
...@@ -61,4 +63,3 @@ Paused at: ...@@ -61,4 +63,3 @@ Paused at:
------------- -------------
-> resume -> resume
Finished.
...@@ -62,16 +62,16 @@ function call_div() { ...@@ -62,16 +62,16 @@ function call_div() {
contextGroup.addScript(call_div.toString()); contextGroup.addScript(call_div.toString());
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
await Protocol.Debugger.setPauseOnExceptions({state: 'all'}); await Protocol.Debugger.setPauseOnExceptions({state: 'all'});
InspectorTest.log('Instantiating.'); InspectorTest.log('Instantiating.');
await WasmInspectorTest.instantiate(module_bytes); await WasmInspectorTest.instantiate(module_bytes);
InspectorTest.log('Calling div function.'); InspectorTest.log('Calling div function.');
await Protocol.Runtime.evaluate({'expression': 'call_div()'}); await Protocol.Runtime.evaluate({'expression': 'call_div()'});
InspectorTest.log('Finished.'); }
InspectorTest.completeTest(); ]);
})();
async function printLocalScope(frame) { async function printLocalScope(frame) {
InspectorTest.log(`scope at ${frame.functionName} (${ InspectorTest.log(`scope at ${frame.functionName} (${
......
Step into a function that starts with a non-breakable opcode (i.e. block), then step from there. See https://crbug.com/1137710. Step into a function that starts with a non-breakable opcode (i.e. block), then step from there. See https://crbug.com/1137710.
Running test: test
Setting up global instance variable. Setting up global instance variable.
Got wasm script: wasm://wasm/4658c40e Got wasm script: wasm://wasm/4658c40e
Setting breakpoint on offset 44 Setting breakpoint on offset 44
......
...@@ -21,7 +21,8 @@ var main = builder.addFunction('main', kSig_v_i) ...@@ -21,7 +21,8 @@ var main = builder.addFunction('main', kSig_v_i)
var module_bytes = builder.toArray(); var module_bytes = builder.toArray();
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
InspectorTest.logProtocolCommandCalls('Debugger.stepInto'); InspectorTest.logProtocolCommandCalls('Debugger.stepInto');
InspectorTest.logProtocolCommandCalls('Debugger.resume'); InspectorTest.logProtocolCommandCalls('Debugger.resume');
...@@ -50,5 +51,5 @@ var module_bytes = builder.toArray(); ...@@ -50,5 +51,5 @@ var module_bytes = builder.toArray();
Protocol.Debugger[action](); Protocol.Debugger[action]();
} }
InspectorTest.log('exports.main returned.'); InspectorTest.log('exports.main returned.');
})().catch(reason => InspectorTest.log(`Failed: ${reason}`)) }
.finally(InspectorTest.completeTest); ]);
Tests stepping through wasm scripts by byte offsets Tests stepping through wasm scripts by byte offsets
Running test: test
Setting up global instance variable. Setting up global instance variable.
Got wasm script: wasm://wasm/42af3c82 Got wasm script: wasm://wasm/42af3c82
Setting breakpoint on offset 72 (should be propagated to 73, the offset of the call), url wasm://wasm/42af3c82 Setting breakpoint on offset 72 (should be propagated to 73, the offset of the call), url wasm://wasm/42af3c82
...@@ -66,4 +68,3 @@ Removing breakpoint ...@@ -66,4 +68,3 @@ Removing breakpoint
Debugger.stepOver called Debugger.stepOver called
Script wasm://wasm/42af3c82 byte offset 95: Wasm opcode 0x20 (kExprLocalGet) Script wasm://wasm/42af3c82 byte offset 95: Wasm opcode 0x20 (kExprLocalGet)
Debugger.resume called Debugger.resume called
Finished!
Tests stepping from javascript into wasm Tests stepping from javascript into wasm
Running test: test
Calling instantiate function. Calling instantiate function.
Waiting for wasm scripts to be parsed. Waiting for wasm scripts to be parsed.
Ignoring script with url v8://test/instantiate Ignoring script with url v8://test/instantiate
...@@ -28,4 +30,3 @@ paused ...@@ -28,4 +30,3 @@ paused
Script wasm://wasm/7d022e0e byte offset 37: Wasm opcode 0x41 (kExprI32Const) Script wasm://wasm/7d022e0e byte offset 37: Wasm opcode 0x41 (kExprI32Const)
Debugger.resume Debugger.resume
exports.main returned! exports.main returned!
Finished!
...@@ -44,7 +44,8 @@ function test() { ...@@ -44,7 +44,8 @@ function test() {
} }
//# sourceURL=test.js`); //# sourceURL=test.js`);
(async function Test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Calling instantiate function.'); InspectorTest.log('Calling instantiate function.');
WasmInspectorTest.instantiate(module_bytes); WasmInspectorTest.instantiate(module_bytes);
...@@ -61,9 +62,8 @@ function test() { ...@@ -61,9 +62,8 @@ function test() {
InspectorTest.logMessage(msg.result.actualLocation); InspectorTest.logMessage(msg.result.actualLocation);
await Protocol.Runtime.evaluate({expression: 'test()'}); await Protocol.Runtime.evaluate({expression: 'test()'});
InspectorTest.log('exports.main returned!'); InspectorTest.log('exports.main returned!');
InspectorTest.log('Finished!'); }
InspectorTest.completeTest(); ]);
})();
function printFailure(message) { function printFailure(message) {
if (!message.result) { if (!message.result) {
......
Tests that Liftoff does not merge opcodes while stepping Tests that Liftoff does not merge opcodes while stepping
Running test: test
Setting breakpoint at offset 33. Setting breakpoint at offset 33.
Paused at offset 33: [0] Paused at offset 33: [0]
Paused at offset 35: [0, 0] Paused at offset 35: [0, 0]
...@@ -11,4 +13,3 @@ Paused at offset 33: [13] ...@@ -11,4 +13,3 @@ Paused at offset 33: [13]
Paused at offset 35: [13, 13] Paused at offset 35: [13, 13]
Paused at offset 36: [13, 0] Paused at offset 36: [13, 0]
Paused at offset 38: [13] Paused at offset 38: [13]
Finished.
...@@ -21,7 +21,8 @@ let module_bytes = builder.toArray(); ...@@ -21,7 +21,8 @@ let module_bytes = builder.toArray();
let wasm_script_id = undefined; let wasm_script_id = undefined;
Protocol.Debugger.onPaused(printPauseLocationAndStep); Protocol.Debugger.onPaused(printPauseLocationAndStep);
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
WasmInspectorTest.instantiate(module_bytes); WasmInspectorTest.instantiate(module_bytes);
[, {params: {scriptId: wasm_script_id}}] = await Protocol.Debugger.onceScriptParsed(2); [, {params: {scriptId: wasm_script_id}}] = await Protocol.Debugger.onceScriptParsed(2);
...@@ -37,9 +38,8 @@ Protocol.Debugger.onPaused(printPauseLocationAndStep); ...@@ -37,9 +38,8 @@ Protocol.Debugger.onPaused(printPauseLocationAndStep);
await Protocol.Runtime.evaluate( await Protocol.Runtime.evaluate(
{expression: `instance.exports.fun(${value})`}); {expression: `instance.exports.fun(${value})`});
} }
InspectorTest.log('Finished.'); }
})().catch(reason => InspectorTest.log(`Failed: ${reason}`)) ]);
.finally(InspectorTest.completeTest);
async function printPauseLocationAndStep(msg) { async function printPauseLocationAndStep(msg) {
// If we are outside of wasm, continue. // If we are outside of wasm, continue.
......
Tests stepping out from javascript to a wasm caller Tests stepping out from javascript to a wasm caller
Running test: test
Instantiating. Instantiating.
Running exports.main. Running exports.main.
>>> First round >>> First round
......
...@@ -32,7 +32,8 @@ function pauseAlternating() { ...@@ -32,7 +32,8 @@ function pauseAlternating() {
} }
`); `);
(async function Test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Instantiating.'); InspectorTest.log('Instantiating.');
const instantiate_code = const instantiate_code =
...@@ -56,6 +57,5 @@ function pauseAlternating() { ...@@ -56,6 +57,5 @@ function pauseAlternating() {
InspectorTest.log('>>> Third round'); InspectorTest.log('>>> Third round');
await Protocol.Runtime.evaluate({expression: 'instance.exports.main()'}); await Protocol.Runtime.evaluate({expression: 'instance.exports.main()'});
InspectorTest.log('exports.main returned.'); InspectorTest.log('exports.main returned.');
}
InspectorTest.completeTest(); ]);
})();
Tests stepping to javascript from wasm Tests stepping to javascript from wasm
Running test: test
Calling instantiate function. Calling instantiate function.
Waiting for wasm scripts to be parsed. Waiting for wasm scripts to be parsed.
Ignoring script with url v8://test/instantiate Ignoring script with url v8://test/instantiate
......
...@@ -61,7 +61,8 @@ function test() { ...@@ -61,7 +61,8 @@ function test() {
} }
//# sourceURL=test.js`); //# sourceURL=test.js`);
(async function Test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Calling instantiate function.'); InspectorTest.log('Calling instantiate function.');
WasmInspectorTest.instantiate(module_bytes); WasmInspectorTest.instantiate(module_bytes);
...@@ -79,8 +80,8 @@ function test() { ...@@ -79,8 +80,8 @@ function test() {
InspectorTest.log('exports.main returned!'); InspectorTest.log('exports.main returned!');
InspectorTest.log('Finished run '+ i +'!\n'); InspectorTest.log('Finished run '+ i +'!\n');
} }
InspectorTest.completeTest(); }
})(); ]);
function printFailure(message) { function printFailure(message) {
if (!message.result) { if (!message.result) {
......
Tests stepping through wasm scripts by byte offsets Tests stepping through wasm scripts by byte offsets
Running test: test
Setting up global instance variable Setting up global instance variable
Got wasm script: wasm://wasm/befe41aa Got wasm script: wasm://wasm/befe41aa
{ {
...@@ -114,4 +116,3 @@ Input positions array is not sorted or contains duplicate values. ...@@ -114,4 +116,3 @@ Input positions array is not sorted or contains duplicate values.
Test: skip list is not sorted Test: skip list is not sorted
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":50},"end":{"lineNumber":0,"columnNumber":62}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":62}}] Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":50},"end":{"lineNumber":0,"columnNumber":62}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":62}}]
Input positions array is not sorted or contains duplicate values. Input positions array is not sorted or contains duplicate values.
Finished!
...@@ -44,11 +44,8 @@ const call_function_offset = loop_body_start_offset + 12; ...@@ -44,11 +44,8 @@ const call_function_offset = loop_body_start_offset + 12;
const func_a_start_offset = func_a.body_offset; const func_a_start_offset = func_a.body_offset;
const func_a_end_offset = func_a_start_offset + 2; const func_a_end_offset = func_a_start_offset + 2;
runTest() InspectorTest.runAsyncTestSuite([
.catch(reason => InspectorTest.log(`Failed: ${reason}`)) async function test() {
.then(InspectorTest.completeTest);
async function runTest() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
InspectorTest.log('Setting up global instance variable'); InspectorTest.log('Setting up global instance variable');
WasmInspectorTest.instantiate(module_bytes); WasmInspectorTest.instantiate(module_bytes);
...@@ -65,9 +62,8 @@ async function runTest() { ...@@ -65,9 +62,8 @@ async function runTest() {
await checkValidSkipLists(scriptId); await checkValidSkipLists(scriptId);
await checkInvalidSkipLists(scriptId); await checkInvalidSkipLists(scriptId);
}
InspectorTest.log('Finished!'); ]);
}
async function checkValidSkipLists(scriptId) { async function checkValidSkipLists(scriptId) {
InspectorTest.log('Test with valid skip lists'); InspectorTest.log('Test with valid skip lists');
......
Tests stepping through wasm scripts with source maps Tests stepping through wasm scripts with source maps
Running test: test
Got wasm script: wasm://wasm/9b4bf87e Got wasm script: wasm://wasm/9b4bf87e
Script sourceMapURL: abc Script sourceMapURL: abc
Requesting source for wasm://wasm/9b4bf87e... Requesting source for wasm://wasm/9b4bf87e...
...@@ -328,4 +330,3 @@ at (anonymous) (0:17): ...@@ -328,4 +330,3 @@ at (anonymous) (0:17):
-- skipped -- skipped
Debugger.resume called Debugger.resume called
exports.main returned! exports.main returned!
Finished!
...@@ -36,7 +36,8 @@ builder.addCustomSection('sourceMappingURL', [3, 97, 98, 99]); ...@@ -36,7 +36,8 @@ builder.addCustomSection('sourceMappingURL', [3, 97, 98, 99]);
var module_bytes = builder.toArray(); var module_bytes = builder.toArray();
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
for (const action of ['stepInto', 'stepOver', 'stepOut', 'resume']) for (const action of ['stepInto', 'stepOver', 'stepOut', 'resume'])
InspectorTest.logProtocolCommandCalls('Debugger.' + action); InspectorTest.logProtocolCommandCalls('Debugger.' + action);
...@@ -74,9 +75,8 @@ var module_bytes = builder.toArray(); ...@@ -74,9 +75,8 @@ var module_bytes = builder.toArray();
// then just resume. // then just resume.
await waitForPauseAndStep('resume'); await waitForPauseAndStep('resume');
InspectorTest.log('exports.main returned!'); InspectorTest.log('exports.main returned!');
InspectorTest.log('Finished!'); }
InspectorTest.completeTest(); ]);
})();
async function waitForPauseAndStep(stepAction) { async function waitForPauseAndStep(stepAction) {
const {params: {callFrames}} = await Protocol.Debugger.oncePaused(); const {params: {callFrames}} = await Protocol.Debugger.oncePaused();
......
...@@ -54,7 +54,8 @@ let fact = builder.addFunction('fact', kSig_i_i) ...@@ -54,7 +54,8 @@ let fact = builder.addFunction('fact', kSig_i_i)
var module_bytes = builder.toArray(); var module_bytes = builder.toArray();
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
for (const action of ['stepInto', 'stepOver', 'stepOut', 'resume']) for (const action of ['stepInto', 'stepOver', 'stepOut', 'resume'])
InspectorTest.logProtocolCommandCalls('Debugger.' + action); InspectorTest.logProtocolCommandCalls('Debugger.' + action);
...@@ -114,9 +115,8 @@ var module_bytes = builder.toArray(); ...@@ -114,9 +115,8 @@ var module_bytes = builder.toArray();
await Protocol.Debugger.removeBreakpoint({breakpointId}); await Protocol.Debugger.removeBreakpoint({breakpointId});
await Protocol.Debugger.stepOver(); await Protocol.Debugger.stepOver();
await waitForPauseAndStep('resume'); await waitForPauseAndStep('resume');
InspectorTest.log('Finished!'); }
})().catch(reason => InspectorTest.log(`Failed: ${reason}`)) ]);
.finally(InspectorTest.completeTest);
async function waitForPauseAndStep(stepAction) { async function waitForPauseAndStep(stepAction) {
await waitForPause(); await waitForPause();
......
Tests unnamed function in wasm scripts Tests unnamed function in wasm scripts
Running test: test
Running testFunction with generated wasm bytes... Running testFunction with generated wasm bytes...
Paused on 'debugger;' Paused on 'debugger;'
Number of frames: 5 Number of frames: 5
...@@ -7,4 +9,3 @@ Number of frames: 5 ...@@ -7,4 +9,3 @@ Number of frames: 5
- [2] main - [2] main
- [3] testFunction - [3] testFunction
- [4] - [4]
Finished!
...@@ -43,16 +43,15 @@ function testFunction(bytes) { ...@@ -43,16 +43,15 @@ function testFunction(bytes) {
contextGroup.addScript(testFunction.toString()); contextGroup.addScript(testFunction.toString());
(async function test() { InspectorTest.runAsyncTestSuite([
async function test() {
await Protocol.Debugger.enable(); await Protocol.Debugger.enable();
Protocol.Debugger.onPaused(handleDebuggerPaused); Protocol.Debugger.onPaused(handleDebuggerPaused);
InspectorTest.log('Running testFunction with generated wasm bytes...'); InspectorTest.log('Running testFunction with generated wasm bytes...');
await Protocol.Runtime.evaluate( await Protocol.Runtime.evaluate(
{'expression': 'testFunction(' + JSON.stringify(module_bytes) + ')'}); {'expression': 'testFunction(' + JSON.stringify(module_bytes) + ')'});
}
InspectorTest.log('Finished!'); ]);
InspectorTest.completeTest();
})();
function logStackTrace(messageObject) { function logStackTrace(messageObject) {
var frames = messageObject.params.callFrames; var frames = messageObject.params.callFrames;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment