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

Side by Side Diff: tests/dom/async_window_test.dart

Issue 10191033: test renaming overhaul: step 4 client tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « tests/benchmark_smoke/smoketest_lib.dart ('k') | tests/dom/audiocontext_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #library('AsyncWindowTest'); 1 #library('AsyncWindowTest');
2 #import('../../../../lib/unittest/unittest.dart'); 2 #import('../../lib/unittest/unittest.dart');
3 #import('../../../../lib/unittest/dom_config.dart'); 3 #import('../../lib/unittest/dom_config.dart');
4 #import('dart:dom'); 4 #import('dart:dom');
5 5
6 main() { 6 main() {
7 useDomConfiguration(); 7 useDomConfiguration();
8 asyncTest('Window.setTimeout', 1, () { 8 asyncTest('Window.setTimeout', 1, () {
9 window.setTimeout(callbackDone, 10); 9 window.setTimeout(callbackDone, 10);
10 }); 10 });
11 asyncTest('Window.setInterval', 1, () { 11 asyncTest('Window.setInterval', 1, () {
12 int counter = 0; 12 int counter = 0;
13 int id = null; 13 int id = null;
14 id = window.setInterval(() { 14 id = window.setInterval(() {
15 if (counter == 3) { 15 if (counter == 3) {
16 counter = 1024; 16 counter = 1024;
17 window.clearInterval(id); 17 window.clearInterval(id);
18 // Wait some more time to be sure callback won't be invoked any more. 18 // Wait some more time to be sure callback won't be invoked any more.
19 window.setTimeout(callbackDone, 50); 19 window.setTimeout(callbackDone, 50);
20 return; 20 return;
21 } 21 }
22 // As callback should have been cleared on 4th invocation, counter 22 // As callback should have been cleared on 4th invocation, counter
23 // should never be greater than 3. 23 // should never be greater than 3.
24 assert(counter < 3); 24 assert(counter < 3);
25 counter++; 25 counter++;
26 }, 10); 26 }, 10);
27 }); 27 });
28 } 28 }
OLDNEW
« no previous file with comments | « tests/benchmark_smoke/smoketest_lib.dart ('k') | tests/dom/audiocontext_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698