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

Side by Side Diff: tests/lib_strong/async/stream_view_test.dart

Issue 2802973005: Migrate async tests to strong (Closed)
Patch Set: Created 3 years, 8 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
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 // Tests the StreamView class.
6
7 import "package:expect/expect.dart";
8 import "dart:async";
9 import "package:async_helper/async_helper.dart";
10
11 main() {
12 asyncStart();
13 runTest().whenComplete(asyncEnd);
14 }
15
16 Future runTest() async {
17 unreachable([a,b]) { throw "UNREACHABLE"; }
18 int tick = 0;
19 ticker() { tick++; }
20
21 asyncStart();
22
23 // Is const constructor.
24 Stream<int> s = const StreamView<int>(const Stream<int>.empty());
25
26 Expect.isFalse(s is Stream<String>); // Respects type parameter.
27 StreamSubscription<int> sub =
28 s.listen(unreachable, onError: unreachable, onDone: ticker);
29 Expect.isFalse(sub is StreamSubscription<String>); // Type parameter in sub.
30
31 Stream iterableStream = new Stream.fromIterable([1, 2, 3]);
32 Expect.listEquals([1, 2, 3], await iterableStream.toList());
33
34 asyncEnd();
35 }
36
37 Future flushMicrotasks() => new Future.delayed(Duration.ZERO);
OLDNEW
« no previous file with comments | « tests/lib_strong/async/stream_type_test.dart ('k') | tests/lib_strong/async/stream_zones_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698