From d09ebbea10d8a3b4a100d4dc5faa5ba87cab9480 Mon Sep 17 00:00:00 2001 From: Daniel Chevalier Date: Thu, 2 Mar 2023 16:21:30 -0500 Subject: [PATCH 1/3] bring chrome proxy service inline with VmService Behaviour --- dwds/lib/src/services/chrome_proxy_service.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwds/lib/src/services/chrome_proxy_service.dart b/dwds/lib/src/services/chrome_proxy_service.dart index 01546237d..4b0dec99e 100644 --- a/dwds/lib/src/services/chrome_proxy_service.dart +++ b/dwds/lib/src/services/chrome_proxy_service.dart @@ -707,7 +707,7 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension( default: throw RPCError( 'streamListen', - RPCError.kMethodNotFound, + RPCError.kInvalidParams, 'The stream `$streamId` is not supported on web devices', ); } From 243cde057f028c7d89dfe6607bcac9081f0c7a81 Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Fri, 3 Mar 2023 11:12:44 -0500 Subject: [PATCH 2/3] try a custom stream test --- dwds/test/chrome_proxy_service_test.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dwds/test/chrome_proxy_service_test.dart b/dwds/test/chrome_proxy_service_test.dart index cc657e27c..5dff65dbe 100644 --- a/dwds/test/chrome_proxy_service_test.dart +++ b/dwds/test/chrome_proxy_service_test.dart @@ -2020,6 +2020,13 @@ void main() { e.kind == EventKind.kVMUpdate && e.vm!.name == 'test'))); await service.setVMName('test'); }); + + test('custom stream', () async { + expect( + () => service.streamListen('VM'), + throwsA(predicate( + (e) => (e is RPCError) && e.code == RPCError.kInvalidParams))); + }); }); test('Logging', () async { From 421c1c6e05ea18a0939f17350e0b341fd117165a Mon Sep 17 00:00:00 2001 From: Dan Chevalier Date: Fri, 3 Mar 2023 15:52:16 -0500 Subject: [PATCH 3/3] try an actual custom stream --- dwds/test/chrome_proxy_service_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dwds/test/chrome_proxy_service_test.dart b/dwds/test/chrome_proxy_service_test.dart index 5dff65dbe..c83215af5 100644 --- a/dwds/test/chrome_proxy_service_test.dart +++ b/dwds/test/chrome_proxy_service_test.dart @@ -2021,9 +2021,9 @@ void main() { await service.setVMName('test'); }); - test('custom stream', () async { + test('custom stream', () { expect( - () => service.streamListen('VM'), + () => service.streamListen('aCustomStreamId'), throwsA(predicate( (e) => (e is RPCError) && e.code == RPCError.kInvalidParams))); });