Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(794)

Side by Side Diff: test/inspector/debugger/asm-js-breakpoint-during-exec.js

Issue 2891213002: [inspector] Refactor protocol-test.js (Closed)
Patch Set: comments addressed Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « test/inspector/debugger/asm-js-breakpoint-before-exec.js ('k') | test/inspector/debugger/asm-js-stack.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698