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

Unified Diff: samples/tests/samples/lib/layout/layout_test.dart

Issue 12218131: Combine window.setTimeout/setInterval with Timer and Timer.repeating. Also (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: samples/tests/samples/lib/layout/layout_test.dart
diff --git a/samples/tests/samples/lib/layout/layout_test.dart b/samples/tests/samples/lib/layout/layout_test.dart
index 031eb139530d684128601aa182a510f97b48ed45..cad5d8c62c1041601009ad436af21c2f9217eac9 100644
--- a/samples/tests/samples/lib/layout/layout_test.dart
+++ b/samples/tests/samples/lib/layout/layout_test.dart
@@ -5,6 +5,7 @@
library layout_tests;
import 'dart:html';
+impodrt 'dart:async';
blois 2013/02/13 03:09:24 import. And alphabetize?
Emily Fortuna 2013/02/13 20:19:44 Oh, man! I ran the tests and everything passed. I
import '../../../../swarm/swarm_ui_lib/base/base.dart';
import '../../../../swarm/swarm_ui_lib/layout/layout.dart';
import '../../../../swarm/swarm_ui_lib/view/view.dart';
@@ -156,10 +157,11 @@ main() {
usingGrid(String example, void test_(View grid)) {
final grid = createGrid(GridExamples.styles[example]);
grid.addToDocument(document.body);
- window.setTimeout(() {
+ new Timer(const Duration(milliseconds: 0), () {
floitsch 2013/02/13 10:03:07 Timer.run
Emily Fortuna 2013/02/13 20:19:44 Done.
test_(grid);
- window.setTimeout(expectAsync0(() { grid.removeFromDocument(); }), 0);
- }, 0);
+ new Timer(const Duratoin(milliseconds: 0),
floitsch 2013/02/13 10:03:07 Timer.run (or fix the typo)
Emily Fortuna 2013/02/13 20:19:44 Done.
+ expectAsync0(() { grid.removeFromDocument(); }));
+ });
}
verifyGrid(String example, [Map expected = null]) {
@@ -172,7 +174,7 @@ verifyGrid(String example, [Map expected = null]) {
final values = expected[name];
final node = document.body.query('#$name');
Expect.isNotNull(node);
- window.setImmediate(expectAsync0(() {
+ window.immediate.then(expectAsync1((_) {
Expect.equals(values[0], node.offsetLeft);
Expect.equals(values[1], node.offsetTop);
Expect.equals(values[2], node.offsetWidth);

Powered by Google App Engine
This is Rietveld 408576698