Skip to content

Commit 238ce46

Browse files
aamCommit Queue
authored and
Commit Queue
committed
[vm/debugger] Update service_2/* tests with debugger() expectations.
Follow-up to bbdf87d TEST=ci Bug: #52785 Change-Id: Ia5c83743efe6222396f63d5df77ebb4e39cbd768 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311440 Reviewed-by: Ryan Macnak <[email protected]> Reviewed-by: Daco Harkes <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent 64290e1 commit 238ce46

37 files changed

+343
-194
lines changed

runtime/observatory/tests/service/async_next_regression_18877_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ doAsync(stop) async {
2222
// of the async_op, resulting in the debugger falling through.
2323
final baz = () => print('doAsync($stop) done!');
2424
if (stop) debugger(); // LINE_0.
25-
await foo(); // Line A.
26-
await foo(); // Line B.
27-
await foo(); // Line C.
25+
await foo(); // LINE_A.
26+
await foo(); // LINE_B.
27+
await foo(); // LINE_C.
2828
baz();
2929
return null;
3030
}
@@ -39,8 +39,8 @@ testMain() {
3939
var tests = <IsolateTest>[
4040
hasStoppedAtBreakpoint,
4141
stoppedAtLine(LINE_0),
42-
hasStoppedAtBreakpoint,
4342
stepOver, // debugger()
43+
hasStoppedAtBreakpoint,
4444
stoppedAtLine(LINE_A),
4545
stepOver, // foo()
4646
stoppedAtLine(LINE_A),

runtime/observatory/tests/service/debugger_location_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const int LINE_C = 11;
1717
void testFunction() {
1818
int i = 0;
1919
while (i == 0) {
20-
debugger(); // Line A
20+
debugger(); // LINE_A.
2121
print('loop');
2222
print('loop');
2323
}

runtime/observatory/tests/service/rewind_optimized_out_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import 'package:test/test.dart';
88
import 'service_test_common.dart';
99
import 'test_helper.dart';
1010

11-
int LINE_A = 33;
12-
int LINE_B = 38;
13-
int LINE_C = 41;
14-
int LINE_D = 45;
11+
const int LINE_A = 33;
12+
const int LINE_B = 38;
13+
const int LINE_C = 41;
14+
const int LINE_D = 45;
1515

16-
int LINE_0 = 31;
16+
const int LINE_0 = 31;
1717

1818
int global = 0;
1919

@@ -30,19 +30,19 @@ b3(int x) {
3030
if (global >= 100) {
3131
debugger(); // LINE_0.
3232
}
33-
global = global + 1; // Line A
33+
global = global + 1; // LINE_A.
3434
return sum;
3535
}
3636

3737
@pragma('vm:prefer-inline')
38-
b2(x) => b3(x); // Line B
38+
b2(x) => b3(x); // LINE_B.
3939

4040
@pragma('vm:prefer-inline')
41-
b1(x) => b2(x); // Line C
41+
b1(x) => b2(x); // LINE_C.
4242

4343
test() {
4444
while (true) {
45-
b1(10000); // Line D
45+
b1(10000); // LINE_D.
4646
}
4747
}
4848

runtime/observatory/tests/service/rewind_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ b3(int x) {
3030
if (global >= 100) {
3131
debugger(); // LINE_0.
3232
}
33-
global = global + 1; // Line A
33+
global = global + 1; // LINE_A.
3434
return sum;
3535
}
3636

3737
@pragma('vm:prefer-inline')
38-
b2(x) => b3(x); // Line B
38+
b2(x) => b3(x); // LINE_B.
3939

4040
@pragma('vm:prefer-inline')
41-
b1(x) => b2(x); // Line C
41+
b1(x) => b2(x); // LINE_C.
4242

4343
test() {
4444
while (true) {
45-
b1(10000); // Line D
45+
b1(10000); // LINE_D.
4646
}
4747
}
4848

runtime/observatory/tests/service/step_into_async_no_await_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ asyncWithoutAwait() async {
1818
}
1919

2020
testMain() {
21-
debugger();
22-
asyncWithoutAwait(); // Line A.
21+
debugger(); // LINE_0.
22+
asyncWithoutAwait(); // LINE_A.
2323
}
2424

2525
var tests = <IsolateTest>[

runtime/observatory_2/tests/service_2/async_next_regression_18877_test.dart

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import 'dart:developer';
77
import 'service_test_common.dart';
88
import 'test_helper.dart';
99

10-
const int LINE_A = 23;
11-
const int LINE_B = 24;
12-
const int LINE_C = 25;
10+
const int LINE_A = 25;
11+
const int LINE_B = 26;
12+
const int LINE_C = 27;
13+
14+
const int LINE_0 = 24;
1315

1416
foo() async {}
1517

@@ -19,10 +21,10 @@ doAsync(stop) async {
1921
// an await causes the implicit breakpoint to be set for that closure instead
2022
// of the async_op, resulting in the debugger falling through.
2123
final baz = () => print('doAsync($stop) done!');
22-
if (stop) debugger();
23-
await foo(); // Line A.
24-
await foo(); // Line B.
25-
await foo(); // Line C.
24+
if (stop) debugger(); // LINE_0.
25+
await foo(); // LINE_A.
26+
await foo(); // LINE_B.
27+
await foo(); // LINE_C.
2628
baz();
2729
return null;
2830
}
@@ -35,6 +37,9 @@ testMain() {
3537
}
3638

3739
var tests = <IsolateTest>[
40+
hasStoppedAtBreakpoint,
41+
stoppedAtLine(LINE_0),
42+
stepOver, // debugger()
3843
hasStoppedAtBreakpoint,
3944
stoppedAtLine(LINE_A),
4045
stepOver, // foo()

runtime/observatory_2/tests/service_2/async_next_test.dart

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ import 'dart:developer';
77
import 'service_test_common.dart';
88
import 'test_helper.dart';
99

10-
const int LINE_A = 18;
11-
const int LINE_B = 19;
12-
const int LINE_C = 20;
10+
const int LINE_A = 20;
11+
const int LINE_B = 21;
12+
const int LINE_C = 22;
13+
14+
const int LINE_0 = 19;
1315

1416
foo() async {}
1517

1618
doAsync(stop) async {
17-
if (stop) debugger();
18-
await foo(); // Line A.
19-
await foo(); // Line B.
20-
await foo(); // Line C.
19+
if (stop) debugger(); // LINE_0.
20+
await foo(); // LINE_A.
21+
await foo(); // LINE_B.
22+
await foo(); // LINE_C.
2123
return null;
2224
}
2325

@@ -29,6 +31,9 @@ testMain() {
2931
}
3032

3133
var tests = <IsolateTest>[
34+
hasStoppedAtBreakpoint,
35+
stoppedAtLine(LINE_0),
36+
stepOver, // debugger()
3237
hasStoppedAtBreakpoint,
3338
stoppedAtLine(LINE_A),
3439
stepOver, // foo()

runtime/observatory_2/tests/service_2/async_single_step_exception_test.dart

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import 'dart:developer';
88
import 'service_test_common.dart';
99
import 'test_helper.dart';
1010

11-
const LINE_A = 20;
12-
const LINE_B = 21;
13-
const LINE_C = 27;
14-
const LINE_D = 29;
15-
const LINE_E = 32;
16-
const LINE_F = 35;
17-
const LINE_G = 37;
11+
const LINE_A = 22;
12+
const LINE_B = 23;
13+
const LINE_C = 29;
14+
const LINE_D = 31;
15+
const LINE_E = 34;
16+
const LINE_F = 37;
17+
const LINE_G = 39;
18+
19+
const LINE_0 = 28;
1820

1921
helper() async {
2022
print('helper'); // LINE_A.
@@ -23,7 +25,7 @@ helper() async {
2325
}
2426

2527
testMain() async {
26-
debugger();
28+
debugger(); // LINE_0.
2729
print('mmmmm'); // LINE_C.
2830
try {
2931
await helper(); // LINE_D.
@@ -38,6 +40,10 @@ testMain() async {
3840
}
3941

4042
var tests = <IsolateTest>[
43+
hasStoppedAtBreakpoint,
44+
stoppedAtLine(LINE_0), // debugger
45+
stepOver,
46+
4147
hasStoppedAtBreakpoint,
4248
stoppedAtLine(LINE_C), // print mmmm
4349
smartNext,

runtime/observatory_2/tests/service_2/async_single_step_into_test.dart

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,30 @@ import 'dart:developer';
88
import 'service_test_common.dart';
99
import 'test_helper.dart';
1010

11-
const LINE_A = 17;
12-
const LINE_B = 18;
13-
const LINE_C = 23;
14-
const LINE_D = 24;
11+
const LINE_A = 19;
12+
const LINE_B = 20;
13+
const LINE_C = 25;
14+
const LINE_D = 26;
15+
16+
const LINE_0 = 24;
1517

1618
helper() async {
1719
print('helper'); // LINE_A.
1820
print('foobar'); // LINE_B.
1921
}
2022

2123
testMain() {
22-
debugger();
24+
debugger(); // LINE_0.
2325
print('mmmmm'); // LINE_C.
2426
helper(); // LINE_D.
2527
print('z');
2628
}
2729

2830
var tests = <IsolateTest>[
31+
hasStoppedAtBreakpoint,
32+
stoppedAtLine(LINE_0),
33+
stepOver, // debugger.
34+
2935
hasStoppedAtBreakpoint,
3036
stoppedAtLine(LINE_C),
3137
stepOver, // print.

runtime/observatory_2/tests/service_2/async_single_step_out_test.dart

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,31 @@ import 'dart:developer';
88
import 'service_test_common.dart';
99
import 'test_helper.dart';
1010

11-
const LINE_A = 18;
12-
const LINE_B = 19;
13-
const LINE_C = 24;
14-
const LINE_D = 25;
15-
const LINE_E = 26;
11+
const LINE_A = 20;
12+
const LINE_B = 21;
13+
const LINE_C = 26;
14+
const LINE_D = 27;
15+
const LINE_E = 28;
16+
17+
const LINE_0 = 25;
1618

1719
helper() async {
1820
print('helper'); // LINE_A.
1921
return null; // LINE_B.
2022
}
2123

2224
testMain() async {
23-
debugger();
25+
debugger(); // LINE_0.
2426
print('mmmmm'); // LINE_C.
2527
await helper(); // LINE_D.
2628
print('z'); // LINE_E.
2729
}
2830

2931
var tests = <IsolateTest>[
32+
hasStoppedAtBreakpoint,
33+
stoppedAtLine(LINE_0), // debugger
34+
stepOver,
35+
3036
hasStoppedAtBreakpoint,
3137
stoppedAtLine(LINE_C), // print mmmm
3238
stepOver,

runtime/observatory_2/tests/service_2/async_star_single_step_into_test.dart

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ import 'dart:developer';
88
import 'service_test_common.dart';
99
import 'test_helper.dart';
1010

11-
const LINE_A = 20;
12-
const LINE_B = 21;
13-
const LINE_C = 25;
14-
const LINE_D = 28;
15-
const LINE_E = 34;
16-
const LINE_F = 35;
17-
const LINE_G = 26;
11+
const LINE_A = 23;
12+
const LINE_B = 24;
13+
const LINE_C = 28;
14+
const LINE_D = 31;
15+
const LINE_E = 37;
16+
const LINE_F = 38;
17+
const LINE_G = 29;
18+
19+
const LINE_0 = 30;
20+
const LINE_1 = 36;
1821

1922
foobar() async* {
2023
yield 1; // LINE_A.
@@ -24,19 +27,23 @@ foobar() async* {
2427
helper() async {
2528
print('helper'); // LINE_C.
2629
await for (var i in foobar()) /* LINE_G. */ {
27-
debugger();
30+
debugger(); // LINE_0.
2831
print('loop'); // LINE_D.
2932
}
3033
}
3134

3235
testMain() {
33-
debugger();
36+
debugger(); // LINE_1.
3437
print('mmmmm'); // LINE_E.
3538
helper(); // LINE_F.
3639
print('z');
3740
}
3841

3942
var tests = <IsolateTest>[
43+
hasStoppedAtBreakpoint,
44+
stoppedAtLine(LINE_1),
45+
stepOver, // debugger.
46+
4047
hasStoppedAtBreakpoint,
4148
stoppedAtLine(LINE_E),
4249
stepOver, // print.
@@ -63,6 +70,10 @@ var tests = <IsolateTest>[
6370
// TODO(johnmccutchan): Implement support for step-out of async functions.
6471
resumeIsolate,
6572

73+
hasStoppedAtBreakpoint,
74+
stoppedAtLine(LINE_0),
75+
stepOver, // debugger.
76+
6677
hasStoppedAtBreakpoint,
6778
stoppedAtLine(LINE_D),
6879
stepOver, // print.

0 commit comments

Comments
 (0)