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

Unified Diff: test/debugger/debug-evaluate-locals-optimized-double.js

Issue 2491543002: [debug-wrapper] Conditional breaks, locals, evaluate, scopes (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 | « no previous file | test/debugger/debug/debug-break-inline.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/debugger/debug-evaluate-locals-optimized-double.js
diff --git a/test/mjsunit/debug-evaluate-locals-optimized-double.js b/test/debugger/debug-evaluate-locals-optimized-double.js
similarity index 75%
rename from test/mjsunit/debug-evaluate-locals-optimized-double.js
rename to test/debugger/debug-evaluate-locals-optimized-double.js
index 84b7e20fe69cf2e3129ae2baa0f4d49b471d24ae..90e79694c0bf7a4061d53ae8a1d9b4679a5fb0de 100644
--- a/test/mjsunit/debug-evaluate-locals-optimized-double.js
+++ b/test/debugger/debug-evaluate-locals-optimized-double.js
@@ -45,23 +45,19 @@ var input = [
];
var expected = [
- { locals: {a0: 1.01, b0: 2.02},
+ { locals: {i: 0, x0: 3.03, y0: 4.04, a0: 1.01, b0: 2.02},
args: { names: ["i", "x0", "y0"], values: [0, 3.03, 4.04] } },
- { locals: {a1: 3.03, b1: 4.04},
+ { locals: {i: 1, x1: 5.05, y1: 6.06, a1: 3.03, b1: 4.04},
args: { names: ["i", "x1", "y1"], values: [1, 5.05, 6.06] } },
- { locals: {a2: 5.05, b2: 6.06},
+ { locals: {i: 2, a2: 5.05, b2: 6.06},
args: { names: ["i"], values: [2] } },
- { locals: {a3: 7.07, b3: 8.08},
+ { locals: {i: 3, x3: 9.09, y3: 10.10, z3: undefined, a3: 7.07, b3: 8.08},
args: { names: ["i", "x3", "y3", "z3"],
values: [3, 9.09, 10.10, undefined] } },
- { locals: {a4: 9.09, b4: 10.10},
+ { locals: {i: 4, x4: 11.11, y4: 12.12, a4: 9.09, b4: 10.10},
args: { names: ["i", "x4", "y4"], values: [4, 11.11, 12.12] } }
];
-function arraySum(arr) {
- return arr.reduce(function (a, b) { return a + b; }, 0);
-}
-
function listener(event, exec_state, event_data, data) {
try {
if (event == Debug.DebugEvent.Break)
@@ -81,13 +77,6 @@ function listener(event, exec_state, event_data, data) {
}
assertPropertiesEqual(expected_locals, locals);
- // All frames except the bottom one have expected arguments.
- for (var j = 0; j < expected_args.names.length; j++) {
- assertEquals(expected_args.names[j], frame.argumentName(j));
- assertEquals(expected_args.values[j],
- frame.argumentValue(j).value());
- }
-
// All frames except the bottom one have two scopes.
assertEquals(3, frame.scopeCount());
assertEquals(debug.ScopeType.Local, frame.scope(0).scopeType());
@@ -117,22 +106,6 @@ function listener(event, exec_state, event_data, data) {
assertEquals(arg_value, frame.evaluate(arg_name).value());
assertEquals(arg_value, frame.evaluate('arguments['+j+']').value());
}
-
- var expected_args_sum = arraySum(expected_args.values);
- var expected_locals_sum =
- arraySum(Object.keys(expected_locals).
- map(function (k) { return expected_locals[k]; }));
-
- assertEquals(expected_locals_sum + expected_args_sum,
- frame.evaluate(Object.keys(expected_locals).join('+') +
- ' + ' +
- expected_args.names.join('+')).value());
-
- var arguments_sum = expected_args.names.map(function(_, idx) {
- return "arguments[" + idx + "]";
- }).join('+');
- assertEquals(expected_args_sum,
- frame.evaluate(arguments_sum).value());
} else {
// The bottom frame only have the global scope.
assertEquals(2, frame.scopeCount());
@@ -142,28 +115,14 @@ function listener(event, exec_state, event_data, data) {
// Check the frame function.
switch (i) {
- case 0: assertEquals(h, frame.func().value()); break;
- case 1: assertEquals(g3, frame.func().value()); break;
- case 2: assertEquals(g2, frame.func().value()); break;
- case 3: assertEquals(g1, frame.func().value()); break;
- case 4: assertEquals(f, frame.func().value()); break;
+ case 0: assertEquals("h", frame.func().name()); break;
+ case 1: assertEquals("g3", frame.func().name()); break;
+ case 2: assertEquals("g2", frame.func().name()); break;
+ case 3: assertEquals("g1", frame.func().name()); break;
+ case 4: assertEquals("f", frame.func().name()); break;
case 5: break;
default: assertUnreachable();
}
-
- // Check for construct call.
- if (i == 4) {
- assertEquals(testingConstructCall, frame.isConstructCall());
- } else if (i == 2) {
- assertTrue(frame.isConstructCall());
- } else {
- assertFalse(frame.isConstructCall());
- }
-
- if (i > 4) {
- assertFalse(frame.isOptimizedFrame());
- assertFalse(frame.isInlinedFrame());
- }
}
// Indicate that all was processed.
« no previous file with comments | « no previous file | test/debugger/debug/debug-break-inline.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698