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

Unified Diff: test/debugger/debug/debug-evaluate-locals-optimized.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
Index: test/debugger/debug/debug-evaluate-locals-optimized.js
diff --git a/test/mjsunit/debug-evaluate-locals-optimized.js b/test/debugger/debug/debug-evaluate-locals-optimized.js
similarity index 73%
rename from test/mjsunit/debug-evaluate-locals-optimized.js
rename to test/debugger/debug/debug-evaluate-locals-optimized.js
index 9d539fe2824f0d726e7b364c188924dc62e24407..32e53795028396499c90670cb18d33fa37bfee66 100644
--- a/test/mjsunit/debug-evaluate-locals-optimized.js
+++ b/test/debugger/debug/debug-evaluate-locals-optimized.js
@@ -25,10 +25,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --expose-debug-as debug --expose-gc --allow-natives-syntax
+// Flags: --expose-gc
// Flags: --inline-construct
-// Get the Debug object exposed from the debug context global object.
Debug = debug.Debug
var listenerComplete = false;
@@ -37,22 +36,18 @@ var exception = false;
var testingConstructCall = false;
var expected = [
- { locals: {a0: 1, b0: 2},
+ { locals: {i: 0, x0: 3, y0: 4, a0: 1, b0: 2},
args: { names: ["i", "x0", "y0"], values: [0, 3, 4] } },
- { locals: {a1: 3, b1: 4},
+ { locals: {i: 1, x1: 5, y1: 6, a1: 3, b1: 4},
args: { names: ["i", "x1", "y1"], values: [1, 5, 6] } },
- { locals: {a2: 5, b2: 6},
+ { locals: {i: 2, a2: 5, b2: 6},
args: { names: ["i"], values: [2] } },
- { locals: {a3: 7, b3: 8},
+ { locals: {i: 3, x3: 9, y3: 10, z3: undefined, a3: 7, b3: 8},
args: { names: ["i", "x3", "y3", "z3"], values: [3, 9, 10, undefined] } },
- { locals: {a4: 9, b4: 10},
+ { locals: {i: 4, x4: 11, y4: 12, a4: 9, b4: 10},
args: { names: ["i", "x4", "y4"], values: [4, 11, 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)
@@ -72,13 +67,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 three scopes.
assertEquals(3, frame.scopeCount());
assertEquals(debug.ScopeType.Local, frame.scope(0).scopeType());
@@ -108,22 +96,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 script scope and the global scope.
assertEquals(2, frame.scopeCount());
@@ -133,28 +105,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 | « test/debugger/debug/debug-evaluate-locals-capturing.js ('k') | test/debugger/debug/debug-evaluate-modify-catch-block-scope.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698