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

Side by Side Diff: tests/lib_strong/html/async_periodictimer.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files 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
1 library async_periodictimer; 1 library async_periodictimer;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'package:unittest/unittest.dart'; 4 import 'package:unittest/unittest.dart';
5 5
6 main(message, replyTo) { 6 main(message, replyTo) {
7 var command = message.first; 7 var command = message.first;
8 expect(command, 'START'); 8 expect(command, 'START');
9 int counter = 0; 9 int counter = 0;
10 new Timer.periodic(const Duration(milliseconds: 10), (timer) { 10 new Timer.periodic(const Duration(milliseconds: 10), (timer) {
11 if (counter == 3) { 11 if (counter == 3) {
12 counter = 1024; 12 counter = 1024;
13 timer.cancel(); 13 timer.cancel();
14 // Wait some more time to be sure callback won't be invoked any 14 // Wait some more time to be sure callback won't be invoked any
15 // more. 15 // more.
16 new Timer(const Duration(milliseconds: 30), () { 16 new Timer(const Duration(milliseconds: 30), () {
17 replyTo.send('DONE'); 17 replyTo.send('DONE');
18 }); 18 });
19 return; 19 return;
20 } 20 }
21 assert(counter < 3); 21 assert(counter < 3);
22 counter++; 22 counter++;
23 }); 23 });
24 } 24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698