[flutter_tools] use Url path.Context for joining URI (#79566)
This commit is contained in:
@@ -643,6 +643,19 @@ void main() {
|
||||
|
||||
expect(processVmServiceMessage(event), 'Hello There');
|
||||
});
|
||||
|
||||
testUsingContext('WebSocket URL construction uses correct URI join primitives', () async {
|
||||
final Completer<String> completer = Completer<String>();
|
||||
openChannelForTesting = (String url, {io.CompressionOptions compression}) async {
|
||||
completer.complete(url);
|
||||
throw Exception('');
|
||||
};
|
||||
|
||||
// Construct a URL that does not end in a `/`.
|
||||
await expectLater(() => connectToVmService(Uri.parse('http://localhost:8181/foo')), throwsException);
|
||||
expect(await completer.future, 'ws://localhost:8181/foo/ws');
|
||||
openChannelForTesting = null;
|
||||
});
|
||||
}
|
||||
|
||||
class MockVMService extends Fake implements vm_service.VmService {
|
||||
|
||||
Reference in New Issue
Block a user