Commit 86d38086 authored by yangguo's avatar yangguo Committed by Commit bot

[debug-wrapper] adapt stepping tests to inspector behavior.

R=jgruber@chromium.org
BUG=v8:5530

Review-Url: https://codereview.chromium.org/2530533002
Cr-Commit-Position: refs/heads/master@{#41215}
parent 49165179
......@@ -19,6 +19,8 @@ function listener(event, exec_state, event_data, data) {
"Expected: // Break " + break_count + ".");
if (source.indexOf("StepOver.") !== -1) {
exec_state.prepareStep(Debug.StepAction.StepNext);
} else if (source.indexOf("StepOut.") !== -1) {
exec_state.prepareStep(Debug.StepAction.StepOut);
} else {
exec_state.prepareStep(Debug.StepAction.StepIn);
}
......@@ -46,7 +48,7 @@ Promise.resolve(42)
function promise1() {
debugger; // Break 0.
return exception || 1; // Break 1.
} // Break 2.
} // Break 2. StepOver.
function promise2() {
throw new Error; // Break 3.
......@@ -59,7 +61,7 @@ function promise3() {
function promise4() {
finalize(); // Break 6. StepOver.
return 0; // Break 7.
} // Break 8. StepOver.
} // Break 8. StepOut.
function finalize() {
Promise.resolve().then(function() {
......
......@@ -10,8 +10,9 @@ var log = [];
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
log.push(exec_state.frame(0).sourceLineText().trimLeft());
exec_state.prepareStep(Debug.StepAction.StepNext);
var line = exec_state.frame(0).sourceLineText().trimLeft();
log.push(line);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepNext);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
......
......@@ -6,16 +6,15 @@
var Debug = debug.Debug;
var expected = ["debugger;",
"var x = y;",
"new Promise(f).catch(call_f_with_deeper_stack);",
"var a = 1;", "var a = 1;",
"debugger;",
"var x = y;"];
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
assertEquals(expected.shift(), exec_state.frame(0).sourceLineText().trimLeft());
exec_state.prepareStep(Debug.StepAction.StepNext);
var line = exec_state.frame(0).sourceLineText().trimLeft();
assertEquals(expected.shift(), line);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepNext);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
......
......@@ -10,8 +10,9 @@ var log = [];
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
log.push(exec_state.frame(0).sourceLineText().trimLeft());
exec_state.prepareStep(Debug.StepAction.StepNext);
var line = exec_state.frame(0).sourceLineText().trimLeft();
log.push(line);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepNext);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
......
......@@ -4,15 +4,15 @@
var Debug = debug.Debug;
var expected =
["debugger;", "var x = y;", "var b = 2;", "Debug.setListener(null);"];
var expected = ["debugger;", "var x = y;"];
var log = [];
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
log.push(exec_state.frame(0).sourceLineText().trimLeft());
exec_state.prepareStep(Debug.StepAction.StepNext);
var line = exec_state.frame(0).sourceLineText().trimLeft();
log.push(line);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepNext);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
......
......@@ -18,10 +18,6 @@
'debug/es6/debug-promises/reject-with-undefined-reject': [FAIL],
'debug/es6/debug-promises/reject-with-invalid-reject': [FAIL],
# Issue 5650: Unexpected order of break pauses with microtasks.
'debug/regress/regress-crbug-568477-2': [FAIL],
'debug/es6/debug-stepin-microtasks': [FAIL],
# Issue 5651: Context mismatch in ScopeIterator::Type() for eval default
# parameter value
'debug/es6/debug-scope-default-param-with-eval': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment