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. JS triggers a break, on ' + | 8 'This test runs asm.js which calls back to JS. JS triggers a break, on ' + |
9 'pause we set breakpoints in the asm.js code.'); | 9 'pause 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 28 matching lines...) Expand all Loading... |
46 if (next) next(); | 46 if (next) next(); |
47 } | 47 } |
48 | 48 |
49 InspectorTest.runTestSuite([ | 49 InspectorTest.runTestSuite([ |
50 function enableDebugger(next) { | 50 function enableDebugger(next) { |
51 Protocol.Debugger.enable().then(next); | 51 Protocol.Debugger.enable().then(next); |
52 }, | 52 }, |
53 | 53 |
54 function addScript(next) { | 54 function addScript(next) { |
55 afterScriptParsedCallback = next; | 55 afterScriptParsedCallback = next; |
56 InspectorTest.addScript(testFunction.toString()); | 56 contextGroup.addScript(testFunction.toString()); |
57 }, | 57 }, |
58 | 58 |
59 function runTestFunction(next) { | 59 function runTestFunction(next) { |
60 afterFinishedTestFunctionCallback = next; | 60 afterFinishedTestFunctionCallback = next; |
61 Protocol.Runtime.evaluate({'expression': 'testFunction()'}) | 61 Protocol.Runtime.evaluate({'expression': 'testFunction()'}) |
62 .then(printResultAndContinue.bind(null, null)); | 62 .then(printResultAndContinue.bind(null, null)); |
63 }, | 63 }, |
64 | 64 |
65 function finished(next) { | 65 function finished(next) { |
66 InspectorTest.log('Finished TestSuite.'); | 66 InspectorTest.log('Finished TestSuite.'); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 function handleScriptParsed(messageObject) | 156 function handleScriptParsed(messageObject) |
157 { | 157 { |
158 var scriptId = messageObject.params.scriptId; | 158 var scriptId = messageObject.params.scriptId; |
159 ++numScripts; | 159 ++numScripts; |
160 InspectorTest.log('Script nr ' + numScripts + ' parsed!'); | 160 InspectorTest.log('Script nr ' + numScripts + ' parsed!'); |
161 if (numScripts == 1) { | 161 if (numScripts == 1) { |
162 parsedScriptParams = JSON.parse(JSON.stringify(messageObject.params)); | 162 parsedScriptParams = JSON.parse(JSON.stringify(messageObject.params)); |
163 afterScriptParsedCallback(); | 163 afterScriptParsedCallback(); |
164 } | 164 } |
165 } | 165 } |
OLD | NEW |