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

Unified Diff: runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart

Issue 1393453004: Ensure the debugger considers parameters to be in scope at the method entry debug step. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months 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 | runtime/vm/debugger_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart
diff --git a/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart b/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0e4209afdd7d49932ad46a0456bd16a354ddf4ca
--- /dev/null
+++ b/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart
@@ -0,0 +1,67 @@
+// Copyright (c) 2015, 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.
+// VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug
+
+import 'package:observatory/service_io.dart';
+import 'test_helper.dart';
+import 'dart:developer';
+import 'package:unittest/unittest.dart';
+
+foo(param) {
+ return param;
+}
+
+fooClosure() {
+ theClosureFunction(param) {
+ return param;
+ }
+ return theClosureFunction;
+}
+
+testMain() {
+ debugger();
+ foo("in-scope"); // Line 24
+
+ var f = fooClosure();
+ debugger();
+ f("in-scope"); // Line 28
+}
+
+var tests = [
+ hasStoppedAtBreakpoint,
+ stoppedAtLine(24),
+ (isolate) => isolate.stepInto(),
+ hasStoppedAtBreakpoint,
+ (isolate) async {
+ var stack = await isolate.getStack();
+ Frame top = stack['frames'][0];
+ print(top);
+ expect(top.function.name, equals("foo"));
+ print(top.variables);
+ expect(top.variables.length, equals(1));
+ var param = top.variables[0];
+ expect(param['name'], equals("param"));
+ expect(param['value'].valueAsString, equals("in-scope"));
+ },
+ resumeIsolate,
+
+ hasStoppedAtBreakpoint,
+ stoppedAtLine(28),
+ (isolate) => isolate.stepInto(),
+ hasStoppedAtBreakpoint,
+ (isolate) async {
+ var stack = await isolate.getStack();
+ Frame top = stack['frames'][0];
+ print(top);
+ expect(top.function.name, equals("theClosureFunction"));
+ print(top.variables);
+ expect(top.variables.length, equals(1));
+ var param = top.variables[0];
+ expect(param['name'], equals("param"));
+ expect(param['value'].valueAsString, equals("in-scope"));
+ },
+ resumeIsolate,
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
« no previous file with comments | « no previous file | runtime/vm/debugger_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698