Unverified Commit 2779361b authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Ensure web-server does not force usage of dwds (#44744)

parent 3383b564
...@@ -602,7 +602,7 @@ class _DwdsResidentWebRunner extends ResidentWebRunner { ...@@ -602,7 +602,7 @@ class _DwdsResidentWebRunner extends ResidentWebRunner {
initializePlatform: debuggingOptions.initializePlatform, initializePlatform: debuggingOptions.initializePlatform,
hostname: debuggingOptions.hostname, hostname: debuggingOptions.hostname,
port: debuggingOptions.port, port: debuggingOptions.port,
skipDwds: device is WebServerDevice || !debuggingOptions.buildInfo.isDebug, skipDwds: device.device is WebServerDevice || !debuggingOptions.buildInfo.isDebug,
dartDefines: dartDefines, dartDefines: dartDefines,
); );
// When connecting to a browser, update the message with a seemsSlow notification // When connecting to a browser, update the message with a seemsSlow notification
......
...@@ -48,6 +48,7 @@ void main() { ...@@ -48,6 +48,7 @@ void main() {
MockChromeTab mockChromeTab; MockChromeTab mockChromeTab;
MockWipConnection mockWipConnection; MockWipConnection mockWipConnection;
MockWipDebugger mockWipDebugger; MockWipDebugger mockWipDebugger;
bool didSkipDwds;
setUp(() { setUp(() {
resetChromeForTesting(); resetChromeForTesting();
...@@ -87,6 +88,7 @@ void main() { ...@@ -87,6 +88,7 @@ void main() {
@required String port, @required String port,
@required List<String> dartDefines, @required List<String> dartDefines,
}) async { }) async {
didSkipDwds = skipDwds;
return mockWebFs; return mockWebFs;
}, },
}, },
...@@ -127,9 +129,9 @@ void main() { ...@@ -127,9 +129,9 @@ void main() {
when(mockWipConnection.debugger).thenReturn(mockWipDebugger); when(mockWipConnection.debugger).thenReturn(mockWipDebugger);
} }
test('runner with web server device does not support debugging', () => testbed.run(() { test('runner with web server device does not support debugging', () => testbed.run(() async {
when(mockFlutterDevice.device).thenReturn(WebServerDevice()); when(mockFlutterDevice.device).thenReturn(WebServerDevice());
final ResidentRunner profileResidentWebRunner = residentWebRunner = DwdsWebRunnerFactory().createWebRunner( final ResidentRunner profileResidentWebRunner = DwdsWebRunnerFactory().createWebRunner(
mockFlutterDevice, mockFlutterDevice,
flutterProject: FlutterProject.current(), flutterProject: FlutterProject.current(),
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
...@@ -145,6 +147,20 @@ void main() { ...@@ -145,6 +147,20 @@ void main() {
expect(residentWebRunner.debuggingEnabled, true); expect(residentWebRunner.debuggingEnabled, true);
})); }));
test('runner with web server device does not initialize dwds', () => testbed.run(() async {
_setupMocks();
when(mockFlutterDevice.device).thenReturn(WebServerDevice());
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
unawaited(residentWebRunner.run(
connectionInfoCompleter: connectionInfoCompleter,
));
await connectionInfoCompleter.future;
expect(didSkipDwds, true);
}));
test('profile does not supportsServiceProtocol', () => testbed.run(() { test('profile does not supportsServiceProtocol', () => testbed.run(() {
when(mockFlutterDevice.device).thenReturn(mockChromeDevice); when(mockFlutterDevice.device).thenReturn(mockChromeDevice);
final ResidentRunner profileResidentWebRunner = DwdsWebRunnerFactory().createWebRunner( final ResidentRunner profileResidentWebRunner = DwdsWebRunnerFactory().createWebRunner(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment