Skip to content

Commit 2bec0ec

Browse files
committed
fix(cupertino_http): Disable local close code tests on macOS
Disabling the tests due to #1814
1 parent c8355d1 commit 2bec0ec

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

pkgs/cupertino_http/example/integration_test/web_socket_conformance_test.dart

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,39 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
import 'dart:io';
6+
57
import 'package:cupertino_http/cupertino_http.dart';
68
import 'package:test/test.dart';
9+
import 'package:web_socket/web_socket.dart';
710
import 'package:web_socket_conformance_tests/web_socket_conformance_tests.dart';
811

9-
void main() {
10-
testAll(CupertinoWebSocket.connect);
12+
void runTests(
13+
Future<WebSocket> Function(Uri uri, {Iterable<String>? protocols})
14+
webSocketFactory,
15+
) {
16+
if (Platform.isMacOS) {
17+
// TODO(https://github.com/dart-lang/http/issues/1814): Fix web socket tests
18+
// on macOS.
19+
testCloseRemote(webSocketFactory);
20+
testConnectUri(webSocketFactory);
21+
testDisconnectAfterUpgrade(webSocketFactory);
22+
testNoUpgrade(webSocketFactory);
23+
testPayloadTransfer(webSocketFactory);
24+
testPeerProtocolErrors(webSocketFactory);
25+
testProtocols(webSocketFactory);
26+
} else {
27+
testAll(webSocketFactory);
28+
}
29+
}
1130

31+
void main() {
1232
group('defaultSessionConfiguration', () {
13-
testAll(CupertinoWebSocket.connect);
33+
runTests(CupertinoWebSocket.connect);
1434
});
1535
group('fromSessionConfiguration', () {
1636
final config = URLSessionConfiguration.ephemeralSessionConfiguration();
17-
testAll(
37+
runTests(
1838
(uri, {protocols}) =>
1939
CupertinoWebSocket.connect(uri, protocols: protocols, config: config),
2040
);

pkgs/cupertino_http/example/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dev_dependencies:
3333
sdk: flutter
3434
objective_c: ^8.1.0
3535
test: ^1.21.1
36+
web_socket: '^1.0.0'
3637
web_socket_conformance_tests:
3738
path: ../../web_socket_conformance_tests/
3839

pkgs/web_socket_conformance_tests/lib/web_socket_conformance_tests.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ import 'src/payload_transfer_tests.dart';
1212
import 'src/peer_protocol_errors_tests.dart';
1313
import 'src/protocol_tests.dart';
1414

15+
export 'src/close_local_tests.dart';
16+
export 'src/close_remote_tests.dart';
17+
export 'src/connect_uri_tests.dart';
18+
export 'src/disconnect_after_upgrade_tests.dart';
19+
export 'src/no_upgrade_tests.dart';
20+
export 'src/payload_transfer_tests.dart';
21+
export 'src/peer_protocol_errors_tests.dart';
22+
export 'src/protocol_tests.dart';
23+
1524
/// Runs the entire test suite against the given [WebSocket].
1625
void testAll(
1726
Future<WebSocket> Function(Uri uri, {Iterable<String>? protocols})

0 commit comments

Comments
 (0)