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

Side by Side Diff: runtime/observatory/tests/service/step_through_getter_test.dart

Issue 2752753002: Additional service tests (Closed)
Patch Set: Formatted some tests 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'test_helper.dart';
6 import 'service_test_common.dart';
7
8 const int LINE = 11;
9 const String file = "step_through_getter_test.dart";
10
11 code() {
12 Bar bar = new Bar();
13 print(bar.barXYZ);
14 print(bar.barXYZ2);
15 print(fooXYZ);
16 print(fooXYZ2);
17 }
18
19 get fooXYZ => "fooXYZ";
20
21 get fooXYZ2 {
22 int i = 42;
23 return "Hello, $i!";
24 }
25
26 class Bar {
27 get barXYZ => "barXYZ";
28
29 get barXYZ2 {
30 int i = 42;
31 return "Hello, $i!";
32 }
33 }
34
35 List<String> stops = [];
36 List<String> expected = [
37 "$file:${LINE+0}:5", // after 'code'
38 "$file:${LINE+1}:17", // on 'Bar'
39
40 "$file:${LINE+2}:13", // on 'barXYZ'
41 "$file:${LINE+16}:14", // on '=>' in 'get barXYZ => "barXYZ";'
42 "$file:${LINE+16}:17", // on first '"'
43 "$file:${LINE+2}:3", // on 'print'
44
45 "$file:${LINE+3}:13", // on 'barXYZ2'
46 "$file:${LINE+18}:15", // on '{' in 'get barXYZ2 {'
47 "$file:${LINE+19}:11", // on '='
48 "$file:${LINE+20}:24", // after '"', i.e. on ';'
49 "$file:${LINE+20}:5", // on 'return'
50 "$file:${LINE+3}:3", // on 'print'
51
52 "$file:${LINE+4}:9", // on 'fooXYZ'
53 "$file:${LINE+8}:12", // on '=>' in 'get fooXYZ => "fooXYZ";'
54 "$file:${LINE+8}:15", // on first '"'
55 "$file:${LINE+4}:3", // on 'print'
56
57 "$file:${LINE+5}:9", // on 'fooXYZ2'
58 "$file:${LINE+10}:13", // on '{'
59 "$file:${LINE+11}:9", // on '='
60 "$file:${LINE+12}:22", // after '"', i.e. on ';'
61 "$file:${LINE+12}:3", // on 'return'
62 "$file:${LINE+5}:3", // on 'print'
63
64 "$file:${LINE+6}:1" // on ending '}'
65 ];
66
67 var tests = [
68 hasPausedAtStart,
69 setBreakpointAtLine(LINE),
70 runStepIntoThroughProgramRecordingStops(stops),
71 checkRecordedStops(stops, expected,
72 debugPrint: true, debugPrintFile: file, debugPrintLine: LINE)
73 ];
74
75 main(args) {
76 runIsolateTestsSynchronous(args, tests,
77 testeeConcurrent: code, pause_on_start: true, pause_on_exit: true);
78 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698