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

Side by Side Diff: tests/html/async_test.dart

Issue 13477002: Do early return before checks below. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | 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 library async_test; 1 library async_test;
2 2
3 import '../../pkg/unittest/lib/unittest.dart'; 3 import '../../pkg/unittest/lib/unittest.dart';
4 import '../../pkg/unittest/lib/html_config.dart'; 4 import '../../pkg/unittest/lib/html_config.dart';
5 5
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:isolate'; 7 import 'dart:isolate';
8 import 'dart:html'; 8 import 'dart:html';
9 9
10 oneshotTimerIsolate() { 10 oneshotTimerIsolate() {
(...skipping 11 matching lines...) Expand all
22 int counter = 0; 22 int counter = 0;
23 new Timer.periodic(const Duration(milliseconds: 10), (timer) { 23 new Timer.periodic(const Duration(milliseconds: 10), (timer) {
24 if (counter == 3) { 24 if (counter == 3) {
25 counter = 1024; 25 counter = 1024;
26 timer.cancel(); 26 timer.cancel();
27 // Wait some more time to be sure callback won't be invoked any 27 // Wait some more time to be sure callback won't be invoked any
28 // more. 28 // more.
29 new Timer(const Duration(milliseconds: 30), () { 29 new Timer(const Duration(milliseconds: 30), () {
30 replyTo.send('DONE'); 30 replyTo.send('DONE');
31 }); 31 });
32 return;
32 } 33 }
33 assert(counter < 3); 34 assert(counter < 3);
34 counter++; 35 counter++;
35 }); 36 });
36 }); 37 });
37 } 38 }
38 39
39 cancellingIsolate() { 40 cancellingIsolate() {
40 port.receive((msg, replyTo) { 41 port.receive((msg, replyTo) {
41 expect(msg, 'START'); 42 expect(msg, 'START');
(...skipping 26 matching lines...) Expand all
68 }); 69 });
69 test('periodic timer in pure isolate', () { 70 test('periodic timer in pure isolate', () {
70 expect(spawnFunction(periodicTimerIsolate).call('START'), 71 expect(spawnFunction(periodicTimerIsolate).call('START'),
71 completion('DONE')); 72 completion('DONE'));
72 }); 73 });
73 test('cancellation in pure isolate', () { 74 test('cancellation in pure isolate', () {
74 expect(spawnFunction(cancellingIsolate).call('START'), 75 expect(spawnFunction(cancellingIsolate).call('START'),
75 completion('DONE')); 76 completion('DONE'));
76 }); 77 });
77 } 78 }
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