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

Side by Side Diff: client/tests/client/dom/AsyncWindowTest.dart

Issue 9537001: Generate dart:html bindings for Dartium as well as Frog. All unittests now pass (or are disabled fo… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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
OLDNEW
1 #library('AsyncWindowTest'); 1 #library('AsyncWindowTest');
2 #import('../../../testing/unittest/unittest.dart'); 2 #import('../../../testing/unittest/unittest_dom.dart');
3 #import('dart:dom'); 3 #import('dart:dom');
4 4
5 main() { 5 main() {
6 forLayoutTests(); 6 forLayoutTests();
7 asyncTest('Window.setTimeout', 1, () { 7 asyncTest('Window.setTimeout', 1, () {
8 window.setTimeout(callbackDone, 10); 8 window.setTimeout(callbackDone, 10);
9 }); 9 });
10 asyncTest('Window.setInterval', 1, () { 10 asyncTest('Window.setInterval', 1, () {
11 int counter = 0; 11 int counter = 0;
12 int id = null; 12 int id = null;
13 id = window.setInterval(() { 13 id = window.setInterval(() {
14 if (counter == 3) { 14 if (counter == 3) {
15 counter = 1024; 15 counter = 1024;
16 window.clearInterval(id); 16 window.clearInterval(id);
17 // Wait some more time to be sure callback won't be invoked any more. 17 // Wait some more time to be sure callback won't be invoked any more.
18 window.setTimeout(callbackDone, 50); 18 window.setTimeout(callbackDone, 50);
19 return; 19 return;
20 } 20 }
21 // As callback should have been cleared on 4th invocation, counter 21 // As callback should have been cleared on 4th invocation, counter
22 // should never be greater than 3. 22 // should never be greater than 3.
23 assert(counter < 3); 23 assert(counter < 3);
24 counter++; 24 counter++;
25 }, 10); 25 }, 10);
26 }); 26 });
27 } 27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698