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

Unified Diff: tests/standalone/debugger/mixin_closure_debugger_test.dart

Issue 102453002: VM debugger: fix closures in mixed-in functions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | « tests/standalone/debugger/debug_lib.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/debugger/mixin_closure_debugger_test.dart
===================================================================
--- tests/standalone/debugger/mixin_closure_debugger_test.dart (revision 0)
+++ tests/standalone/debugger/mixin_closure_debugger_test.dart (working copy)
@@ -0,0 +1,54 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// This test forks a second vm process that runs this dart script as
+// a debug target.
+// Run this test with option --wire to see the json messages sent
+// between the processes.
+// Run this test with option --verbose to see the stdout and stderr output
+// of the debug target process.
+
+// This test checks that a breakpoint can be set and is hit in a closure
+// inside a mixin function. Regression test for issue 15325.
+
+import "debug_lib.dart";
+
+class S { }
+
+class M {
+ m() {
+ var sum = 0;
+ [1,2,3].forEach((e) {
+ sum += e; // Breakpoint here.
+ });
+ return sum;
+ }
+}
+
+class A = S with M;
+
+main(List<String> arguments) {
+ if (RunScript(testScript, arguments)) return;
+ var a = new A();
+ print(a.m());
+}
+
+// Expected debugger events and commands.
+var testScript = [
+ MatchFrame(0, "main"), // Top frame in trace is function "main".
+ SetBreakpoint(23), // Set breakpoint inside the forEach closure.
+ Resume(),
+ MatchFrames(["S&M.<anonymous closure>", "forEach", "S&M.m"],
+ exactMatch: false), // First iteration.
+ MatchLocals({"e": "1"}),
+ Resume(),
+ MatchFrames(["S&M.<anonymous closure>", "forEach", "S&M.m"],
+ exactMatch: false), // Second iteration.
+ MatchLocals({"e": "2"}),
+ Resume(),
+ MatchFrames(["S&M.<anonymous closure>", "forEach", "S&M.m"],
+ exactMatch: false), // Third iteration.
+ MatchLocals({"e": "3"}),
+ Resume(),
+];
« no previous file with comments | « tests/standalone/debugger/debug_lib.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698