Skip to content

Commit 9db2740

Browse files
committed
Remove ChromeProxyService.setExceptionPauseMode()
1 parent 3e2364e commit 9db2740

File tree

3 files changed

+17
-32
lines changed

3 files changed

+17
-32
lines changed

dwds/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Include an optional param to `Dwds.start` to indicate whether it a Flutter app
1313
or not.
1414
- Pre-warm expression compiler cache to speed up Flutter Inspector loading.
15+
- Remove `ChromeProxyService.setExceptionPauseMode()`.
1516

1617
## 16.0.1
1718

dwds/lib/src/services/chrome_proxy_service.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -776,15 +776,10 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
776776
{String? exceptionPauseMode, bool? shouldPauseOnExit}) async {
777777
// TODO(elliette): Is there a way to respect the shouldPauseOnExit parameter
778778
// in Chrome?
779-
return setExceptionPauseMode(
780-
isolateId, exceptionPauseMode ?? ExceptionPauseMode.kNone);
781-
}
782-
783-
@override
784-
Future<Success> setExceptionPauseMode(String isolateId, String mode) async {
785779
await isInitialized;
786-
_checkIsolate('setExceptionPauseMode', isolateId);
787-
return (await debuggerFuture).setExceptionPauseMode(mode);
780+
_checkIsolate('setIsolatePauseMode', isolateId);
781+
return (await debuggerFuture)
782+
.setExceptionPauseMode(exceptionPauseMode ?? ExceptionPauseMode.kNone);
788783
}
789784

790785
@override

dwds/test/chrome_proxy_service_test.dart

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,25 +1135,6 @@ void main() {
11351135
expect(stack.truncated, isFalse);
11361136
});
11371137

1138-
test('break on exceptions with legacy setExceptionPauseMode', () async {
1139-
final oldPauseMode =
1140-
(await service.getIsolate(isolateId!)).exceptionPauseMode!;
1141-
await service.setExceptionPauseMode(
1142-
isolateId!, ExceptionPauseMode.kAll);
1143-
// Wait for pausing to actually propagate.
1144-
final event = await stream
1145-
.firstWhere((event) => event.kind == EventKind.kPauseException);
1146-
expect(event.exception, isNotNull);
1147-
// Check that the exception stack trace has been mapped to Dart source files.
1148-
expect(event.exception!.valueAsString, contains('main.dart'));
1149-
1150-
final stack = await service.getStack(isolateId!);
1151-
expect(stack, isNotNull);
1152-
1153-
await service.setExceptionPauseMode(isolateId!, oldPauseMode);
1154-
await service.resume(isolateId!);
1155-
});
1156-
11571138
test('break on exceptions with setIsolatePauseMode', () async {
11581139
final oldPauseMode =
11591140
(await service.getIsolate(isolateId!)).exceptionPauseMode;
@@ -1492,17 +1473,25 @@ void main() {
14921473
await expectLater(service.reloadSources(''), throwsRPCError);
14931474
});
14941475

1495-
test('setExceptionPauseMode', () async {
1476+
test('setIsolatePauseMode', () async {
14961477
final vm = await service.getVM();
14971478
final isolateId = vm.isolates!.first.id!;
1498-
expect(await service.setExceptionPauseMode(isolateId, 'all'), _isSuccess);
1499-
expect(await service.setExceptionPauseMode(isolateId, 'unhandled'),
1479+
expect(
1480+
await service.setIsolatePauseMode(isolateId,
1481+
exceptionPauseMode: ExceptionPauseMode.kAll),
1482+
_isSuccess);
1483+
expect(
1484+
await service.setIsolatePauseMode(isolateId,
1485+
exceptionPauseMode: ExceptionPauseMode.kUnhandled),
15001486
_isSuccess);
15011487
// Make sure this is the last one - or future tests might hang.
15021488
expect(
1503-
await service.setExceptionPauseMode(isolateId, 'none'), _isSuccess);
1489+
await service.setIsolatePauseMode(isolateId,
1490+
exceptionPauseMode: ExceptionPauseMode.kNone),
1491+
_isSuccess);
15041492
await expectLater(
1505-
service.setExceptionPauseMode(isolateId, 'invalid'), throwsRPCError);
1493+
service.setIsolatePauseMode(isolateId, exceptionPauseMode: 'invalid'),
1494+
throwsRPCError);
15061495
});
15071496

15081497
test('setFlag', () async {

0 commit comments

Comments
 (0)