blob: b6399af9f7786e61422880138c0459af9b31e3c8 [file] [log] [blame]
// Copyright (c) 2017, 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.
/// @assertion void add(data)
/// Sends data on the WebSocket connection. The data in data must be either a
/// String, or a List<int> holding bytes.
/// @description Checks that the List<int> data are sent on the WebSocket
/// connection from client.
/// @author
import "dart:io";
import "../../../Utils/expect.dart";
import "../http_utils.dart";
const List<int> BYTES = const [1, 2, 3];
main() {
(HttpServer? server) async {
WebSocket ws = await WebSocket.connect("ws://${server?.address.address}:${server?.port}/");
setup: () => spawnWebSocketServer(
(WebSocket ws) =>[BYTES], ws)
cleanup: (HttpServer? server) => server?.close()