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

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

Issue 912513002: Status updates, and minor fixes to tests of async-await. (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 | « tests/language/asyncstar_yieldstar_test.dart ('k') | tests/language/language.status » ('j') | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 bool cancelled; 9 bool cancelled;
10 10
(...skipping 28 matching lines...) Expand all
39 for (int j = 0; j < 10; j++) { 39 for (int j = 0; j < 10; j++) {
40 if (j == 5) continue outer; 40 if (j == 5) continue outer;
41 } 41 }
42 } 42 }
43 } 43 }
44 } finally { 44 } finally {
45 Expect.isTrue(cancelled); 45 Expect.isTrue(cancelled);
46 } 46 }
47 } 47 }
48 48
49 main() async { 49 test() async {
50 await test1(); 50 await test1();
51 await test2(); 51 await test2();
52 }
52 53
54 main() async {
55 asyncStart();
56 test().then((_) {
57 asyncEnd();
58 });
53 } 59 }
54 60
55 61
56 // Create a stream that produces numbers [1, 2, ... ] 62 // Create a stream that produces numbers [1, 2, ... ]
57 StreamController infiniteStreamController() { 63 StreamController infiniteStreamController() {
58 StreamController controller; 64 StreamController controller;
59 Timer timer; 65 Timer timer;
60 int counter = 0; 66 int counter = 0;
61 67
62 void tick(_) { 68 void tick(_) {
(...skipping 16 matching lines...) Expand all
79 onListen: startTimer, 85 onListen: startTimer,
80 onPause: stopTimer, 86 onPause: stopTimer,
81 onResume: startTimer, 87 onResume: startTimer,
82 onCancel: () { 88 onCancel: () {
83 cancelled = true; 89 cancelled = true;
84 stopTimer(); 90 stopTimer();
85 }); 91 });
86 92
87 return controller; 93 return controller;
88 } 94 }
OLDNEW
« no previous file with comments | « tests/language/asyncstar_yieldstar_test.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698