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

Unified Diff: test/mjsunit/es6/debug-promises/stepin-constructor.js

Issue 1404783002: Debugger: allow stepping into resolver from Promise constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | test/mjsunit/es6/debug-promises/stepin-handler.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/debug-promises/stepin-constructor.js
diff --git a/test/mjsunit/regress/regress-crbug-119800.js b/test/mjsunit/es6/debug-promises/stepin-constructor.js
similarity index 62%
copy from test/mjsunit/regress/regress-crbug-119800.js
copy to test/mjsunit/es6/debug-promises/stepin-constructor.js
index 1641cac686ef8c56699ff5140b805f6e9b1abf07..4f3891b1878b01e60693295503dd0e472d5b51f3 100644
--- a/test/mjsunit/regress/regress-crbug-119800.js
+++ b/test/mjsunit/es6/debug-promises/stepin-constructor.js
@@ -4,12 +4,6 @@
// Flags: --expose-debug-as debug
-function f() {
- 1;
- 2;
- 3;
-}
-
var Debug = debug.Debug;
var exception = null;
var breaks = [];
@@ -17,8 +11,7 @@ var breaks = [];
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
- Debug.debuggerFlags().breakPointsActive.setValue(false);
- breaks.push(exec_state.frame().sourceLineText().trimLeft());
+ breaks.push(exec_state.frame(0).sourceLineText().trimLeft());
exec_state.prepareStep(Debug.StepAction.StepIn, 1);
} catch (e) {
exception = e;
@@ -26,12 +19,29 @@ function listener(event, exec_state, event_data, data) {
}
Debug.setListener(listener);
-Debug.setBreakPoint(f, 0, 0);
-f();
+function resolver(resolve, reject) {
+ 1;
+ 2;
+ 3;
+ resolve();
+}
+
+debugger;
+var p = new Promise(resolver);
Debug.setListener(null);
-Debug.debuggerFlags().breakPointsActive.setValue(true);
+var expected_breaks = [
+ "debugger;",
+ "var p = new Promise(resolver);",
+ "1;",
+ "2;",
+ "3;",
+ "resolve();",
+ "}",
+ "Debug.setListener(null);"
+];
+
+assertEquals(expected_breaks, breaks);
assertNull(exception);
-assertEquals(breaks, ["1;", "2;", "3;", "}", "Debug.setListener(null);"]);
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | test/mjsunit/es6/debug-promises/stepin-handler.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698