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

Side by Side Diff: tests/language/asyncstar_yield_test.dart

Issue 915603002: Use a 0-length timer in async test to make jsshell happy. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 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 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 "dart:async"; 5 import "dart:async";
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 import "package:async_helper/async_helper.dart"; 7 import "package:async_helper/async_helper.dart";
8 8
9 Stream<int> foo1() async* { 9 Stream<int> foo1() async* {
10 yield 1; 10 yield 1;
11 var p = await new Future.value(10); 11 var p = await new Future.value(10);
12 yield p + 10; 12 yield p + 10;
13 } 13 }
14 14
15 Stream<int> foo2() async* { 15 Stream<int> foo2() async* {
16 int i = 0; 16 int i = 0;
17 while (true) { 17 while (true) {
18 await (new Future.delayed(new Duration(milliseconds: 10), () {})); 18 await (new Future.delayed(new Duration(milliseconds: 0), () {}));
19 if (i > 10) return; 19 if (i > 10) return;
20 yield i; 20 yield i;
21 i++; 21 i++;
22 } 22 }
23 } 23 }
24 24
25 Stream<int> foo3(p) async* { 25 Stream<int> foo3(p) async* {
26 int i = 0; 26 int i = 0;
27 bool t = false; 27 bool t = false;
28 yield null; 28 yield null;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 await (foo4().take(10).toList())); 66 await (foo4().take(10).toList()));
67 Expect.isTrue(await (finalized.future)); 67 Expect.isTrue(await (finalized.future));
68 } 68 }
69 69
70 main () { 70 main () {
71 asyncStart(); 71 asyncStart();
72 test().then((_) { 72 test().then((_) {
73 asyncEnd(); 73 asyncEnd();
74 }); 74 });
75 } 75 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698