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

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

Issue 2680303002: Kernel debugging; service tests (Closed)
Patch Set: Changes based on feedback. Also fixed regress_28443_test Created 3 years, 10 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/next_through_create_list_and_map_test.dart
diff --git a/runtime/observatory/tests/service/next_through_create_list_and_map_test.dart b/runtime/observatory/tests/service/next_through_create_list_and_map_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..26bc0c9f6a4890cd9768ecc1d1a3e1d9177fffe1
--- /dev/null
+++ b/runtime/observatory/tests/service/next_through_create_list_and_map_test.dart
@@ -0,0 +1,91 @@
+// 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_A = 12;
+const String file = "next_through_create_list_and_map_test.dart";
+
+code() {
+ List<int> myList = [
+ 1234567890,
+ 1234567891,
+ 1234567892,
+ 1234567893,
+ 1234567894
+ ];
+ List<int> myConstList = const [
+ 1234567890,
+ 1234567891,
+ 1234567892,
+ 1234567893,
+ 1234567894
+ ];
+ Map<int, int> myMap = {
+ 1: 42,
+ 2: 43,
+ 33242344: 432432432,
+ 443243232: 543242454
+ };
+ Map<int, int> myConstMap = const {
+ 1: 42,
+ 2: 43,
+ 33242344: 432432432,
+ 443243232: 543242454
+ };
+ print(myList);
+ print(myConstList);
+ int lookup = myMap[1];
+ print(lookup);
+ print(myMap);
+ print(myConstMap);
+ print(myMap[2]);
+}
+
+List<String> stops = [];
+List<String> expected = [
+ // Initialize list
+ "$file:${LINE_A+0}:22",
+
+ // Initialize const list
+ "$file:${LINE_A+7}:25",
+
+ // Initialize map
+ "$file:${LINE_A+14}:25",
+
+ // Initialize const map
+ "$file:${LINE_A+20}:28",
+
+ // Prints
+ "$file:${LINE_A+26}:3",
+ "$file:${LINE_A+27}:3",
+
+ // Lookup
+ "$file:${LINE_A+28}:21",
+
+ // Prints
+ "$file:${LINE_A+29}:3",
+ "$file:${LINE_A+30}:3",
+ "$file:${LINE_A+31}:3",
+
+ // Lookup + print
+ "$file:${LINE_A+32}:14",
+ "$file:${LINE_A+32}:3",
+
+ // End
+ "$file:${LINE_A+33}:1"
+];
+
+var tests = [
+ hasPausedAtStart,
+ setBreakpointAtLine(LINE_A),
+ runStepThroughProgramRecordingStops(stops),
+ checkRecordedStops(stops, expected)
+];
+
+main(args) {
+ runIsolateTestsSynchronous(args, tests,
+ testeeConcurrent: code, pause_on_start: true, pause_on_exit: true);
+}

Powered by Google App Engine
This is Rietveld 408576698