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

Side by Side Diff: tests/lib/async/slow_consumer2_test.dart

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // VMOptions=--old_gen_heap_size=32 5 // VMOptions=--old_gen_heap_size=32
6 6
7 library slow_consumer2_test; 7 library slow_consumer2_test;
8 8
9 import "package:expect/expect.dart";
9 import 'dart:async'; 10 import 'dart:async';
10 import 'dart:isolate'; 11 import 'dart:isolate';
11 12
12 const int KB = 1024; 13 const int KB = 1024;
13 const int MB = KB * KB; 14 const int MB = KB * KB;
14 const int GB = KB * KB * KB; 15 const int GB = KB * KB * KB;
15 16
16 class SlowConsumer extends StreamConsumer { 17 class SlowConsumer extends StreamConsumer {
17 int receivedCount = 0; 18 int receivedCount = 0;
18 final int bytesPerSecond; 19 final int bytesPerSecond;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // file). If the consumer doesn't pause the data-provider it will run out of 98 // file). If the consumer doesn't pause the data-provider it will run out of
98 // heap-space. 99 // heap-space.
99 100
100 new DataProvider(800 * MB, 100 * MB, 1 * MB).stream 101 new DataProvider(800 * MB, 100 * MB, 1 * MB).stream
101 .pipe(new SlowConsumer(200 * MB, 5 * MB)) 102 .pipe(new SlowConsumer(200 * MB, 5 * MB))
102 .then((count) { 103 .then((count) {
103 port.close(); 104 port.close();
104 Expect.equals(100 * MB, count); 105 Expect.equals(100 * MB, count);
105 }); 106 });
106 } 107 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698