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

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

Issue 808643004: Support breakpoints in deferred libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/deferred_code_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/deferred_code_test.dart
===================================================================
--- tests/standalone/debugger/deferred_code_test.dart (revision 0)
+++ tests/standalone/debugger/deferred_code_test.dart (working copy)
@@ -0,0 +1,46 @@
+// Copyright (c) 2014, 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.
+
+// Test to verify that a breakpoint can be set in code that is not yet
+// loaded, i.e. in a deferred library.
+//
+// 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.
+
+import "debug_lib.dart";
+import "deferred_code_lib.dart" deferred as D;
+
+
+main(List<String> arguments) {
+ if (RunScript(testScript, arguments)) return;
+ var loaded = false;
+ print("Hello from debuggee");
+ D.loadLibrary().then((_) {
+ loaded = true;
+ print("Done loading deferred library");
+ D.stopTheBuck();
+ });
+ print("main terminates");
+}
+
+
+// Expected debugger events and commands.
+var testScript = [
+ MatchFrame(0, "main"), // Top frame in trace is function "main".
+ SetBreakpoint(22), // Breakpoint just before call to loadLibrary().
+ Resume(),
+ // Set BP in deferred library code before the loadLibrary() call is executed.
+ MatchFrame(0, "main"),
+ MatchLine(22),
+ MatchLocals({"loaded": "false"}),
+ SetBreakpoint(10, url: "deferred_code_lib.dart"),
+ Resume(),
+ MatchFrame(0, "stopTheBuck"), // Expect to be stopped in deferred library code.
+ // MatchLine(10), // Line matching only works for the main script.
+ Resume(),
+];
« no previous file with comments | « tests/standalone/debugger/deferred_code_lib.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698