| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --validate-asm --allow-natives-syntax | 5 // Flags: --validate-asm --allow-natives-syntax |
| 6 | 6 |
| 7 InspectorTest.log( | 7 let {session, contextGroup, Protocol} = InspectorTest.start( |
| 8 'This test runs asm.js which calls back to JS. Before executing (after ' + | 8 'This test runs asm.js which calls back to JS. Before executing (after ' + |
| 9 'the script is parsed) we set breakpoints in the asm.js code.'); | 9 'the script is parsed) we set breakpoints in the asm.js code.'); |
| 10 | 10 |
| 11 function testFunction() { | 11 function testFunction() { |
| 12 function generateAsmJs(stdlib, foreign, heap) { | 12 function generateAsmJs(stdlib, foreign, heap) { |
| 13 'use asm'; | 13 'use asm'; |
| 14 var debugger_fun = foreign.call_debugger; | 14 var debugger_fun = foreign.call_debugger; |
| 15 function callDebugger() { | 15 function callDebugger() { |
| 16 debugger_fun(); | 16 debugger_fun(); |
| 17 } | 17 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 43 next(); | 43 next(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 InspectorTest.runTestSuite([ | 46 InspectorTest.runTestSuite([ |
| 47 function enableDebugger(next) { | 47 function enableDebugger(next) { |
| 48 Protocol.Debugger.enable().then(next); | 48 Protocol.Debugger.enable().then(next); |
| 49 }, | 49 }, |
| 50 | 50 |
| 51 function addScript(next) { | 51 function addScript(next) { |
| 52 afterScriptParsedCallback = next; | 52 afterScriptParsedCallback = next; |
| 53 InspectorTest.addScript(testFunction.toString()); | 53 contextGroup.addScript(testFunction.toString()); |
| 54 }, | 54 }, |
| 55 | 55 |
| 56 function runTestFunction(next) { | 56 function runTestFunction(next) { |
| 57 Protocol.Runtime.evaluate({'expression': 'testFunction()'}) | 57 Protocol.Runtime.evaluate({'expression': 'testFunction()'}) |
| 58 .then(printResultAndContinue.bind(null, next)); | 58 .then(printResultAndContinue.bind(null, next)); |
| 59 }, | 59 }, |
| 60 | 60 |
| 61 function finished(next) { | 61 function finished(next) { |
| 62 InspectorTest.log('Finished TestSuite.'); | 62 InspectorTest.log('Finished TestSuite.'); |
| 63 next(); | 63 next(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 var thisLine = currentLine; | 119 var thisLine = currentLine; |
| 120 currentLine += 1; | 120 currentLine += 1; |
| 121 InspectorTest.log('Setting breakpoint on line ' + thisLine); | 121 InspectorTest.log('Setting breakpoint on line ' + thisLine); |
| 122 Protocol.Debugger | 122 Protocol.Debugger |
| 123 .setBreakpoint( | 123 .setBreakpoint( |
| 124 {'location': {'scriptId': scriptId, 'lineNumber': thisLine}}) | 124 {'location': {'scriptId': scriptId, 'lineNumber': thisLine}}) |
| 125 .then(setNextBreakpoint); | 125 .then(setNextBreakpoint); |
| 126 } | 126 } |
| 127 setNextBreakpoint(); | 127 setNextBreakpoint(); |
| 128 } | 128 } |
| OLD | NEW |