Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: tests/fletchc/driver/test_control_stream.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/fletchc/driver/mock_vm.dart ('k') | tests/fletchc/driver/test_vm_connection.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/fletchc/driver/test_control_stream.dart
diff --git a/tests/fletchc/driver/test_control_stream.dart b/tests/fletchc/driver/test_control_stream.dart
deleted file mode 100644
index c8899290f6f16d0de7a856857be26777d4068adf..0000000000000000000000000000000000000000
--- a/tests/fletchc/driver/test_control_stream.dart
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2015, the Dartino 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.md file.
-
-import 'dart:async';
-
-import 'dart:typed_data';
-
-import 'package:expect/expect.dart';
-
-import 'package:fletchc/src/hub/client_commands.dart';
-
-import 'package:fletchc/src/hub/hub_main.dart';
-
-const List<int> stdinCommandData = const <int>[4, 0, 0, 0, 0, 0, 0, 0, 0];
-
-Future<Null> testControlStream() async {
- StreamController<Uint8List> controller = new StreamController<Uint8List>();
-
- // Test that one byte at the time is handled.
- for (int byte in stdinCommandData) {
- controller.add(new Uint8List.fromList([byte]));
- }
-
- // Test that two bytes at the time are handled.
- for (int i = 0; i < stdinCommandData.length; i += 2) {
- if (i + 1 < stdinCommandData.length) {
- controller.add(
- new Uint8List.fromList(
- [stdinCommandData[i], stdinCommandData[i + 1]]));
- } else {
- controller.add(new Uint8List.fromList([stdinCommandData[i]]));
- }
- }
-
- // Test that data from the next command isn't discarded (when the next
- // command is chunked).
- var testData = <int>[]
- ..addAll(stdinCommandData)
- ..addAll(stdinCommandData.sublist(0, 5));
- controller
- ..add(new Uint8List.fromList(testData))
- ..add(new Uint8List.fromList(stdinCommandData.sublist(5)));
-
- // Test that data from the next command isn't discarded (when there are more
- // than one complete command in the buffer).
- testData = <int>[]
- ..addAll(stdinCommandData)
- ..addAll(stdinCommandData);
- controller.add(new Uint8List.fromList(testData));
-
- StreamTransformer<List<int>, ClientCommand> transformer =
- new ClientCommandTransformerBuilder().build();
- Future<List<ClientCommand>> commandsFuture =
- controller.stream.transform(transformer).toList();
-
- await controller.close();
-
- List<ClientCommand> commands = await commandsFuture;
- Expect.equals(6, commands.length);
- for (ClientCommand command in commands) {
- Expect.stringEquals(
- 'ClientCommand(ClientCommandCode.Stdin, [])',
- '$command');
- }
-}
« no previous file with comments | « tests/fletchc/driver/mock_vm.dart ('k') | tests/fletchc/driver/test_vm_connection.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698