mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This command uses package:test to run Dart tests with sky_shell. For this to work, we need https://github.com/dart-lang/test/tree/hacky-loader-hook to land. We're also not smart enough to find sky_shell ourselves yet. Instead, we take the path as input using an environment variable. Eventually, we'll be able to get the sky_shell executable from package:sky_engine, but we don't yet ship that executable.
20 lines
479 B
Dart
20 lines
479 B
Dart
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'dart:async';
|
|
import 'dart:convert';
|
|
import 'dart:io';
|
|
|
|
class JSONSocket {
|
|
JSONSocket(WebSocket socket)
|
|
: _socket = socket, stream = socket.map(JSON.decode).asBroadcastStream();
|
|
|
|
final WebSocket _socket;
|
|
final Stream stream;
|
|
|
|
void send(dynamic data) {
|
|
_socket.add(JSON.encode(data));
|
|
}
|
|
}
|