Skip to content

Commit 317288a

Browse files
authored
Remove ChromeProxyService.setExceptionPauseMode() (#1820)
* Remove ChromeProxyService.setExceptionPauseMode() * Add missing line from "break on exceptions with setIsolatePauseMode" test * Add test that doesn't supply any optional arguments to setIsolatePauseMode()
1 parent bbe7143 commit 317288a

File tree

3 files changed

+21
-33
lines changed

3 files changed

+21
-33
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: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,26 +1104,6 @@ void main() {
11041104
expect(stack.truncated, isFalse);
11051105
});
11061106

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-
11271107
test('break on exceptions with setIsolatePauseMode', () async {
11281108
final oldPauseMode =
11291109
(await service.getIsolate(isolateId!)).exceptionPauseMode;
@@ -1133,6 +1113,9 @@ void main() {
11331113
final event = await stream
11341114
.firstWhere((event) => event.kind == EventKind.kPauseException);
11351115
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'));
11361119

11371120
final stack = await service.getStack(isolateId!);
11381121
expect(stack, isNotNull);
@@ -1462,17 +1445,26 @@ void main() {
14621445
await expectLater(service.reloadSources(''), throwsRPCError);
14631446
});
14641447

1465-
test('setExceptionPauseMode', () async {
1448+
test('setIsolatePauseMode', () async {
14661449
final vm = await service.getVM();
14671450
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),
14701459
_isSuccess);
14711460
// Make sure this is the last one - or future tests might hang.
14721461
expect(
1473-
await service.setExceptionPauseMode(isolateId, 'none'), _isSuccess);
1462+
await service.setIsolatePauseMode(isolateId,
1463+
exceptionPauseMode: ExceptionPauseMode.kNone),
1464+
_isSuccess);
14741465
await expectLater(
1475-
service.setExceptionPauseMode(isolateId, 'invalid'), throwsRPCError);
1466+
service.setIsolatePauseMode(isolateId, exceptionPauseMode: 'invalid'),
1467+
throwsRPCError);
14761468
});
14771469

14781470
test('setFlag', () async {

0 commit comments

Comments
 (0)