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

Side by Side Diff: tests/dartino_compiler/driver/test_control_stream.dart

Issue 2189923002: Update Dart binaries to 1.18.0-dev.4.4 (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'dart:typed_data'; 7 import 'dart:typed_data';
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 10
11 import 'package:dartino_compiler/src/hub/client_commands.dart'; 11 import 'package:dartino_compiler/src/hub/client_commands.dart';
12 12
13 import 'package:dartino_compiler/src/hub/hub_main.dart'; 13 import 'package:dartino_compiler/src/hub/hub_main.dart';
14 14
15 const List<int> stdinCommandData = const <int>[4, 0, 0, 0, 0, 0, 0, 0, 0]; 15 const List<int> stdinCommandData = const <int>[4, 0, 0, 0, 0, 0, 0, 0, 0];
16 16
17 Future<Null> testControlStream() async { 17 Future<Null> testControlStream() async {
18 StreamController<Uint8List> controller = new StreamController<Uint8List>(); 18 StreamController<List<int>> controller = new StreamController<List<int>>();
19 19
20 // Test that one byte at the time is handled. 20 // Test that one byte at the time is handled.
21 for (int byte in stdinCommandData) { 21 for (int byte in stdinCommandData) {
22 controller.add(new Uint8List.fromList([byte])); 22 controller.add(new Uint8List.fromList([byte]));
23 } 23 }
24 24
25 // Test that two bytes at the time are handled. 25 // Test that two bytes at the time are handled.
26 for (int i = 0; i < stdinCommandData.length; i += 2) { 26 for (int i = 0; i < stdinCommandData.length; i += 2) {
27 if (i + 1 < stdinCommandData.length) { 27 if (i + 1 < stdinCommandData.length) {
28 controller.add( 28 controller.add(
(...skipping 28 matching lines...) Expand all
57 await controller.close(); 57 await controller.close();
58 58
59 List<ClientCommand> commands = await commandsFuture; 59 List<ClientCommand> commands = await commandsFuture;
60 Expect.equals(6, commands.length); 60 Expect.equals(6, commands.length);
61 for (ClientCommand command in commands) { 61 for (ClientCommand command in commands) {
62 Expect.stringEquals( 62 Expect.stringEquals(
63 'ClientCommand(ClientCommandCode.Stdin, [])', 63 'ClientCommand(ClientCommandCode.Stdin, [])',
64 '$command'); 64 '$command');
65 } 65 }
66 } 66 }
OLDNEW
« no previous file with comments | « pkg/power_management/lib/src/native_extension_api.dart ('k') | tests/dartino_tests/snapshot_stacktrace_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698