[flutter_tools] swap web debugging protocol to ws (#82456)

This commit is contained in:
Jonah Williams 2021-05-13 16:04:03 -07:00 committed by GitHub
parent 3266f4d90c
commit 344f3ab7d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View file

@ -211,7 +211,7 @@ abstract class FlutterCommand extends Command<void> {
);
argParser.addOption('web-server-debug-protocol',
allowed: <String>['sse', 'ws'],
defaultsTo: 'sse',
defaultsTo: 'ws',
help: 'The protocol (SSE or WebSockets) to use for the debug service proxy '
'when using the Web Server device and Dart Debug extension. '
'This is useful for editors/debug adapters that do not support debugging '
@ -220,7 +220,7 @@ abstract class FlutterCommand extends Command<void> {
);
argParser.addOption('web-server-debug-backend-protocol',
allowed: <String>['sse', 'ws'],
defaultsTo: 'sse',
defaultsTo: 'ws',
help: 'The protocol (SSE or WebSockets) to use for the Dart Debug Extension '
'backend service when using the Web Server device. '
'Using WebSockets can improve performance but may fail when connecting through '
@ -229,7 +229,7 @@ abstract class FlutterCommand extends Command<void> {
);
argParser.addOption('web-server-debug-injected-client-protocol',
allowed: <String>['sse', 'ws'],
defaultsTo: 'sse',
defaultsTo: 'ws',
help: 'The protocol (SSE or WebSockets) to use for the injected client '
'when using the Web Server device. '
'Using WebSockets can improve performance but may fail when connecting through '

View file

@ -508,6 +508,20 @@ void main() {
'--bundle-sksl-path=foo.json',
]), throwsToolExit(message: 'No SkSL shader bundle found at foo.json'));
});
testUsingContext('Configures web connection options to use web sockets by default', () async {
final RunCommand command = RunCommand();
await expectLater(() => createTestCommandRunner(command).run(<String>[
'run',
'--no-pub',
]), throwsToolExit());
final DebuggingOptions options = await command.createDebuggingOptions(true);
expect(options.webUseSseForDebugBackend, false);
expect(options.webUseSseForDebugProxy, false);
expect(options.webUseSseForInjectedClient, false);
});
}
class MockCache extends Mock implements Cache {}