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

Side by Side Diff: tests/lib/convert/streamed_conversion_utf8_decode_test.dart

Issue 23701010: Switch to async_helper package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase and adapt 3 new tests. Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'unicode_tests.dart'; 8 import 'unicode_tests.dart';
9 import '../../async_helper.dart'; 9 import "package:async_helper/async_helper.dart";
10 10
11 Stream<String> decode(List<int> bytes, int chunkSize) { 11 Stream<String> decode(List<int> bytes, int chunkSize) {
12 var controller; 12 var controller;
13 controller = new StreamController(onListen: () { 13 controller = new StreamController(onListen: () {
14 int i = 0; 14 int i = 0;
15 while (i < bytes.length) { 15 while (i < bytes.length) {
16 List nextChunk = []; 16 List nextChunk = [];
17 for (int j = 0; j < chunkSize; j++) { 17 for (int j = 0; j < chunkSize; j++) {
18 if (i < bytes.length) { 18 if (i < bytes.length) {
19 nextChunk.add(bytes[i]); 19 nextChunk.add(bytes[i]);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 testUnpaused(expected, decode(bytes, 1)); 57 testUnpaused(expected, decode(bytes, 1));
58 testWithPauses(expected, decode(bytes, 1)); 58 testWithPauses(expected, decode(bytes, 1));
59 testUnpaused(expected, decode(bytes, 2)); 59 testUnpaused(expected, decode(bytes, 2));
60 testWithPauses(expected, decode(bytes, 2)); 60 testWithPauses(expected, decode(bytes, 2));
61 testUnpaused(expected, decode(bytes, 3)); 61 testUnpaused(expected, decode(bytes, 3));
62 testWithPauses(expected, decode(bytes, 3)); 62 testWithPauses(expected, decode(bytes, 3));
63 testUnpaused(expected, decode(bytes, 4)); 63 testUnpaused(expected, decode(bytes, 4));
64 testWithPauses(expected, decode(bytes, 4)); 64 testWithPauses(expected, decode(bytes, 4));
65 } 65 }
66 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698