mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 21:11:19 +00:00
368b3f0ab4
Changes from original CL:
* Removed service_undocumented.md
* Removed generation of wrappers for undocumented RPCs
* Cleaned up generation code which was used for generating wrappers for undocumented RPCs
* Removed JARs from pkg/vm_service/java/third_party
This reverts commit 477a3c4748
.
Change-Id: I8d36733c8b2602e4935c3f23698d3f7c97a20187
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110135
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
36 lines
1.6 KiB
Dart
36 lines
1.6 KiB
Dart
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'package:test/test.dart';
|
|
import 'package:vm_service/utils.dart';
|
|
|
|
void main() {
|
|
test('convertToWebSocketUrl maps URIs correctly', () {
|
|
final testCases = {
|
|
'http://localhost:123/': 'ws://localhost:123/ws',
|
|
'https://localhost:123/': 'wss://localhost:123/ws',
|
|
'ws://localhost:123/': 'ws://localhost:123/ws',
|
|
'wss://localhost:123/': 'wss://localhost:123/ws',
|
|
'http://localhost:123/ABCDEF=/': 'ws://localhost:123/ABCDEF=/ws',
|
|
'https://localhost:123/ABCDEF=/': 'wss://localhost:123/ABCDEF=/ws',
|
|
'ws://localhost:123/ABCDEF=/': 'ws://localhost:123/ABCDEF=/ws',
|
|
'wss://localhost:123/ABCDEF=/': 'wss://localhost:123/ABCDEF=/ws',
|
|
'http://localhost:123': 'ws://localhost:123/ws',
|
|
'https://localhost:123': 'wss://localhost:123/ws',
|
|
'ws://localhost:123': 'ws://localhost:123/ws',
|
|
'wss://localhost:123': 'wss://localhost:123/ws',
|
|
'http://localhost:123/ABCDEF=': 'ws://localhost:123/ABCDEF=/ws',
|
|
'https://localhost:123/ABCDEF=': 'wss://localhost:123/ABCDEF=/ws',
|
|
'ws://localhost:123/ABCDEF=': 'ws://localhost:123/ABCDEF=/ws',
|
|
'wss://localhost:123/ABCDEF=': 'wss://localhost:123/ABCDEF=/ws',
|
|
};
|
|
|
|
testCases.forEach((String input, String expected) {
|
|
final inputUri = Uri.parse(input);
|
|
final actualUri = convertToWebSocketUrl(serviceProtocolUrl: inputUri);
|
|
expect(actualUri.toString(), equals(expected));
|
|
});
|
|
});
|
|
}
|