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

Side by Side Diff: test/codegen/lib/html/async_periodictimer.dart

Issue 1930043002: Add all dart:html tests from the sdk to test/codegen. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: ptal Created 4 years, 7 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 library async_periodictimer;
2
3 import 'dart:async';
4 import 'package:unittest/unittest.dart';
5
6 main(message, replyTo) {
7 var command = message.first;
8 expect(command, 'START');
9 int counter = 0;
10 new Timer.periodic(const Duration(milliseconds: 10), (timer) {
11 if (counter == 3) {
12 counter = 1024;
13 timer.cancel();
14 // Wait some more time to be sure callback won't be invoked any
15 // more.
16 new Timer(const Duration(milliseconds: 30), () {
17 replyTo.send('DONE');
18 });
19 return;
20 }
21 assert(counter < 3);
22 counter++;
23 });
24 }
OLDNEW
« no previous file with comments | « test/codegen/lib/html/async_oneshot.dart ('k') | test/codegen/lib/html/async_spawnuri_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698