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

Side by Side Diff: test/debugger/debug/es6/debug-stepin-microtasks.js

Issue 2758483002: [debugger] tuned StepNext and StepOut at return position (Closed)
Patch Set: addressed comments Created 3 years, 9 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 5
6 Debug = debug.Debug 6 Debug = debug.Debug
7 var exception = null; 7 var exception = null;
8 var break_count = 0; 8 var break_count = 0;
9 const expected_breaks = 9; 9 const expected_breaks = 10;
10 10
11 function listener(event, exec_state, event_data, data) { 11 function listener(event, exec_state, event_data, data) {
12 try { 12 try {
13 if (event == Debug.DebugEvent.Break) { 13 if (event == Debug.DebugEvent.Break) {
14 assertTrue(exec_state.frameCount() != 0, "FAIL: Empty stack trace"); 14 assertTrue(exec_state.frameCount() != 0, "FAIL: Empty stack trace");
15 var source = exec_state.frame(0).sourceLineText(); 15 var source = exec_state.frame(0).sourceLineText();
16 print("paused at: " + source); 16 print("paused at: " + source);
17 assertTrue(source.indexOf("// Break " + break_count + ".") > 0, 17 assertTrue(source.indexOf("// Break " + break_count + ".") > 0,
18 "Unexpected pause at: " + source + "\n" + 18 "Unexpected pause at: " + source + "\n" +
19 "Expected: // Break " + break_count + "."); 19 "Expected: // Break " + break_count + ".");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return break_count; // Break 4. 58 return break_count; // Break 4.
59 } // Break 5. 59 } // Break 5.
60 60
61 function promise4() { 61 function promise4() {
62 finalize(); // Break 6. StepOver. 62 finalize(); // Break 6. StepOver.
63 return 0; // Break 7. 63 return 0; // Break 7.
64 } // Break 8. StepOut. 64 } // Break 8. StepOut.
65 65
66 function finalize() { 66 function finalize() {
67 Promise.resolve().then(function() { 67 Promise.resolve().then(function() {
68 if (expected_breaks !== break_count) { 68 if (expected_breaks !== break_count) { // Break 9. StepOut.
69 %AbortJS("FAIL: expected <" + expected_breaks + "> breaks instead of <" + 69 %AbortJS("FAIL: expected <" + expected_breaks + "> breaks instead of <" +
70 break_count + ">"); 70 break_count + ">");
71 } 71 }
72 if (exception !== null) { 72 if (exception !== null) {
73 %AbortJS("FAIL: exception: " + exception); 73 %AbortJS("FAIL: exception: " + exception);
74 } 74 }
75 }); 75 });
76 } 76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698