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

Side by Side Diff: test/inspector/debugger/step-over-caught-exception.js

Issue 2390733002: [inspector] Make InspectorTest.sendCommand* private (Closed)
Patch Set: addressed comments Created 4 years, 2 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 InspectorTest.evaluateInPage( 5 InspectorTest.addScript(
6 `function testFunction() 6 `function testFunction()
7 { 7 {
8 function foo() 8 function foo()
9 { 9 {
10 try { 10 try {
11 throw new Error(); 11 throw new Error();
12 } catch (e) { 12 } catch (e) {
13 } 13 }
14 } 14 }
15 debugger; 15 debugger;
16 foo(); 16 foo();
17 console.log("completed"); 17 console.log("completed");
18 }`); 18 }`);
19 19
20 InspectorTest.sendCommandOrDie("Debugger.enable", {}); 20 Protocol.Debugger.enable();
21 InspectorTest.sendCommandOrDie("Runtime.enable", {}); 21 Protocol.Runtime.enable();
22 step1(); 22 step1();
23 23
24 function step1() 24 function step1()
25 { 25 {
26 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "setTimeout (testFunction, 0);"}); 26 Protocol.Runtime.evaluate({ "expression": "setTimeout(testFunction, 0);"});
27 var commands = [ "Print", "stepOver", "stepOver", "Print", "resume" ]; 27 var commands = [ "Print", "stepOver", "stepOver", "Print", "resume" ];
28 InspectorTest.eventHandler["Debugger.paused"] = function(messageObject) 28 Protocol.Debugger.onPaused(function(messageObject)
29 { 29 {
30 var command = commands.shift(); 30 var command = commands.shift();
31 if (command === "Print") { 31 if (command === "Print") {
32 var callFrames = messageObject.params.callFrames; 32 var callFrames = messageObject.params.callFrames;
33 for (var callFrame of callFrames) 33 for (var callFrame of callFrames)
34 InspectorTest.log(callFrame.functionName + ":" + callFrame.location.line Number); 34 InspectorTest.log(callFrame.functionName + ":" + callFrame.location.line Number);
35 command = commands.shift(); 35 command = commands.shift();
36 } 36 }
37 if (command) 37 if (command)
38 InspectorTest.sendCommandOrDie("Debugger." + command, {}); 38 Protocol.Debugger[command]();
39 } 39 });
40 40
41 InspectorTest.eventHandler["Runtime.consoleAPICalled"] = function(messageObjec t) 41 Protocol.Runtime.onConsoleAPICalled(function(messageObject)
42 { 42 {
43 if (messageObject.params.args[0].value === "completed") { 43 if (messageObject.params.args[0].value === "completed") {
44 if (commands.length) 44 if (commands.length)
45 InspectorTest.log("[FAIL]: execution was resumed too earlier.") 45 InspectorTest.log("[FAIL]: execution was resumed too earlier.")
46 step2(); 46 step2();
47 } 47 }
48 } 48 });
49 } 49 }
50 50
51 function step2() 51 function step2()
52 { 52 {
53 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "setTimeout (testFunction, 0);"}); 53 Protocol.Runtime.evaluate({ "expression": "setTimeout(testFunction, 0);"});
54 var commands = [ "Print", "stepOver", "stepInto", "stepOver", "stepOver", "Pri nt", "resume" ]; 54 var commands = [ "Print", "stepOver", "stepInto", "stepOver", "stepOver", "Pri nt", "resume" ];
55 InspectorTest.eventHandler["Debugger.paused"] = function(messageObject) 55 Protocol.Debugger.onPaused(function(messageObject)
56 { 56 {
57 var command = commands.shift(); 57 var command = commands.shift();
58 if (command === "Print") { 58 if (command === "Print") {
59 var callFrames = messageObject.params.callFrames; 59 var callFrames = messageObject.params.callFrames;
60 for (var callFrame of callFrames) 60 for (var callFrame of callFrames)
61 InspectorTest.log(callFrame.functionName + ":" + callFrame.location.line Number); 61 InspectorTest.log(callFrame.functionName + ":" + callFrame.location.line Number);
62 command = commands.shift(); 62 command = commands.shift();
63 } 63 }
64 if (command) 64 if (command)
65 InspectorTest.sendCommandOrDie("Debugger." + command, {}); 65 Protocol.Debugger[command]();
66 } 66 });
67 67
68 InspectorTest.eventHandler["Runtime.consoleAPICalled"] = function(messageObjec t) 68 Protocol.Runtime.onConsoleAPICalled(function(messageObject)
69 { 69 {
70 if (messageObject.params.args[0].value === "completed") { 70 if (messageObject.params.args[0].value === "completed") {
71 if (commands.length) 71 if (commands.length)
72 InspectorTest.log("[FAIL]: execution was resumed too earlier.") 72 InspectorTest.log("[FAIL]: execution was resumed too earlier.")
73 InspectorTest.completeTest(); 73 InspectorTest.completeTest();
74 } 74 }
75 } 75 });
76 } 76 }
OLDNEW
« no previous file with comments | « test/inspector/debugger/set-script-source.js ('k') | test/inspector/debugger/stepping-with-blackboxed-ranges.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698