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

Unified Diff: samples/tests/samples/src/swarm/SwarmTest.dart

Issue 10031022: step 1 in making unittest platform independent. (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 side-by-side diff with in-line comments
Download patch
Index: samples/tests/samples/src/swarm/SwarmTest.dart
diff --git a/samples/tests/samples/src/swarm/SwarmTest.dart b/samples/tests/samples/src/swarm/SwarmTest.dart
index 437f32996fa2c3fe632da0fa164313c84037947c..628ae034f86e5fd43aa95b3f363132bfbefa59ef 100644
--- a/samples/tests/samples/src/swarm/SwarmTest.dart
+++ b/samples/tests/samples/src/swarm/SwarmTest.dart
@@ -45,7 +45,7 @@ void main() {
}
asyncTest('BackButton', 1, () {
- serialInvokeAsync([() {
+ _serialInvokeAsync([() {
Expect.equals(null, swarm.frontView.storyView); // verify initial state
// Make sure we've transitioned to the section
@@ -137,3 +137,18 @@ class UIStateProxy extends SwarmState {
clearHistory();
}
}
+
+void _serialInvokeAsync(List closures) {
+ final length = closures.length;
+ if (length > 0) {
+ int i = 0;
+ void invokeNext() {
+ closures[i]();
+ i++;
+ if (i < length) {
+ window.setTimeout(invokeNext, 0);
+ }
+ }
+ window.setTimeout(invokeNext, 0);
+ }
+}
« lib/unittest/config.dart ('K') | « samples/tests/samples/src/dartcombat/DartCombatTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698