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

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

Issue 1391953003: Fix evaluation in frames with _private variable names. (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
Index: runtime/observatory/tests/service/evaluate_in_frame_rpc_test.dart
diff --git a/runtime/observatory/tests/service/evaluate_in_frame_rpc_test.dart b/runtime/observatory/tests/service/evaluate_in_frame_rpc_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..053fd158951d7200c6429e90d645db5371b204c1
--- /dev/null
+++ b/runtime/observatory/tests/service/evaluate_in_frame_rpc_test.dart
@@ -0,0 +1,47 @@
+// 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
+
+import 'dart:async';
+import 'dart:developer';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+void method(int value, _) {
+ debugger();
+}
+
+void testFunction() {
+ int i = 0;
+ while (true) {
+ if (++i % 100000000 == 0) {
+ method(10000, 50);
+ }
+ }
+}
+
+var tests = [
+
+hasStoppedAtBreakpoint,
+
+// Evaluate against library, class, and instance.
+(Isolate isolate) async {
+ var result;
+ result = await isolate.evalFrame(0, 'value');
+ expect(result.valueAsString, equals('10000'));
+
+ result = await isolate.evalFrame(0, '_');
+ expect(result.valueAsString, equals('50'));
+
+ result = await isolate.evalFrame(0, 'value + _');
+ expect(result.valueAsString, equals('10050'));
+
+ result = await isolate.evalFrame(1, 'i');
+ expect(result.valueAsString, equals('100000000'));
+},
+
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);

Powered by Google App Engine
This is Rietveld 408576698