@@ -1104,26 +1104,6 @@ void main() {
1104
1104
expect (stack.truncated, isFalse);
1105
1105
});
1106
1106
1107
- test ('break on exceptions with legacy setExceptionPauseMode' , () async {
1108
- final oldPauseMode =
1109
- (await service.getIsolate (isolateId! )).exceptionPauseMode! ;
1110
- await service.setExceptionPauseMode (
1111
- isolateId! , ExceptionPauseMode .kAll);
1112
- // Wait for pausing to actually propagate.
1113
- final event = await stream
1114
- .firstWhere ((event) => event.kind == EventKind .kPauseException);
1115
- expect (event.exception, isNotNull);
1116
- // Check that the exception stack trace has been mapped to Dart source files.
1117
- // TODO(https://github.com/dart-lang/webdev/issues/1821) Uncomment.
1118
- // expect(event.exception!.valueAsString, contains('main.dart'));
1119
-
1120
- final stack = await service.getStack (isolateId! );
1121
- expect (stack, isNotNull);
1122
-
1123
- await service.setExceptionPauseMode (isolateId! , oldPauseMode);
1124
- await service.resume (isolateId! );
1125
- });
1126
-
1127
1107
test ('break on exceptions with setIsolatePauseMode' , () async {
1128
1108
final oldPauseMode =
1129
1109
(await service.getIsolate (isolateId! )).exceptionPauseMode;
@@ -1133,6 +1113,9 @@ void main() {
1133
1113
final event = await stream
1134
1114
.firstWhere ((event) => event.kind == EventKind .kPauseException);
1135
1115
expect (event.exception, isNotNull);
1116
+ // Check that the exception stack trace has been mapped to Dart source files.
1117
+ // TODO(https://github.com/dart-lang/webdev/issues/1821) Uncomment.
1118
+ // expect(event.exception!.valueAsString, contains('main.dart'));
1136
1119
1137
1120
final stack = await service.getStack (isolateId! );
1138
1121
expect (stack, isNotNull);
@@ -1462,17 +1445,26 @@ void main() {
1462
1445
await expectLater (service.reloadSources ('' ), throwsRPCError);
1463
1446
});
1464
1447
1465
- test ('setExceptionPauseMode ' , () async {
1448
+ test ('setIsolatePauseMode ' , () async {
1466
1449
final vm = await service.getVM ();
1467
1450
final isolateId = vm.isolates! .first.id! ;
1468
- expect (await service.setExceptionPauseMode (isolateId, 'all' ), _isSuccess);
1469
- expect (await service.setExceptionPauseMode (isolateId, 'unhandled' ),
1451
+ expect (await service.setIsolatePauseMode (isolateId), _isSuccess);
1452
+ expect (
1453
+ await service.setIsolatePauseMode (isolateId,
1454
+ exceptionPauseMode: ExceptionPauseMode .kAll),
1455
+ _isSuccess);
1456
+ expect (
1457
+ await service.setIsolatePauseMode (isolateId,
1458
+ exceptionPauseMode: ExceptionPauseMode .kUnhandled),
1470
1459
_isSuccess);
1471
1460
// Make sure this is the last one - or future tests might hang.
1472
1461
expect (
1473
- await service.setExceptionPauseMode (isolateId, 'none' ), _isSuccess);
1462
+ await service.setIsolatePauseMode (isolateId,
1463
+ exceptionPauseMode: ExceptionPauseMode .kNone),
1464
+ _isSuccess);
1474
1465
await expectLater (
1475
- service.setExceptionPauseMode (isolateId, 'invalid' ), throwsRPCError);
1466
+ service.setIsolatePauseMode (isolateId, exceptionPauseMode: 'invalid' ),
1467
+ throwsRPCError);
1476
1468
});
1477
1469
1478
1470
test ('setFlag' , () async {
0 commit comments