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

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

Issue 2748333002: [kernel] offsets on direct property get/set (Closed)
Patch Set: Created 3 years, 9 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 | « runtime/observatory/tests/service/step_through_property_get_test.dart ('k') | runtime/vm/kernel_binary.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/step_through_property_set_test.dart
diff --git a/runtime/observatory/tests/service/step_through_property_set_test.dart b/runtime/observatory/tests/service/step_through_property_set_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..317fb29b240b70f41aed081fc286e64a090cb346
--- /dev/null
+++ b/runtime/observatory/tests/service/step_through_property_set_test.dart
@@ -0,0 +1,78 @@
+// Copyright (c) 2017, 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.
+
+import 'test_helper.dart';
+import 'service_test_common.dart';
+
+const int LINE = 33;
+const String file = "step_through_property_set_test.dart";
+
+code() {
+ Bar bar = new Bar();
+ bar.doStuff();
+}
+
+class Foo {
+ final List<String> data1;
+
+ Foo() : data1 = ["a", "b", "c"];
+
+ void doStuff() {
+ data1[1] = 'x';
+ print(data1[1]);
+ }
+}
+
+class Bar extends Foo {
+ final List<String> data2;
+
+ Bar() : data2 = ["d", "e", "f"];
+
+ void doStuff() {
+ data2[1] = '1';
+ print(data2[1]);
+
+ data1[1] = '2';
+ print(data1[1]);
+
+ super.data1[1] = '42';
+ print(super.data1[1]);
+ }
+}
+
+List<String> stops = [];
+List<String> expected = [
+ "$file:${LINE+0}:5", // on 'data2'
+ "$file:${LINE+0}:10", // on '['
+ "$file:${LINE+1}:11", // on 'data2'
+ "$file:${LINE+1}:16", // on '['
+ "$file:${LINE+1}:5", // on 'print'
+
+ "$file:${LINE+3}:5", // on 'data1'
+ "$file:${LINE+3}:10", // on '['
+ "$file:${LINE+4}:11", // on 'data1'
+ "$file:${LINE+4}:16", // on '['
+ "$file:${LINE+4}:5", // on 'print'
+
+ "$file:${LINE+6}:11", // on 'data1'
+ "$file:${LINE+6}:16", // on '['
+ "$file:${LINE+7}:17", // on 'data1'
+ "$file:${LINE+7}:22", // on '['
+ "$file:${LINE+7}:5", // on 'print'
+
+ "$file:${LINE+8}:3" // on ending '}'
+];
+
+var tests = [
+ hasPausedAtStart,
+ setBreakpointAtLine(LINE),
+ runStepIntoThroughProgramRecordingStops(stops),
+ checkRecordedStops(stops, expected,
+ debugPrint: true, debugPrintFile: file, debugPrintLine: LINE)
+];
+
+main(args) {
+ runIsolateTestsSynchronous(args, tests,
+ testeeConcurrent: code, pause_on_start: true, pause_on_exit: true);
+}
« no previous file with comments | « runtime/observatory/tests/service/step_through_property_get_test.dart ('k') | runtime/vm/kernel_binary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698