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

Unified Diff: pkg/intl/test/intl_message_basic_example_test.dart

Issue 11818034: Fix flakiness in intl_message_basic_example_test (7730) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/test/intl_message_basic_example_test.dart
===================================================================
--- pkg/intl/test/intl_message_basic_example_test.dart (revision 16882)
+++ pkg/intl/test/intl_message_basic_example_test.dart (working copy)
@@ -12,6 +12,7 @@
import '../lib/message_lookup_local.dart';
import '../example/basic/basic_example.dart';
import '../../../pkg/unittest/lib/unittest.dart';
+import 'dart:async';
List list;
@@ -20,14 +21,23 @@
setup(runAllTests, addToList);
}
-addToList(x) {list.add(x);}
+var waitForIt = new Completer();
+addToList(x) {
+ list.add(x);
+ if (list.length == 4) waitForIt.complete(list);
+}
+
runAllTests(_) {
setup(runProgram, addToList);
+ waitForIt.future.then(actuallyRunTheTests);
+}
+
+actuallyRunTheTests(_) {
test('Verify basic example printing localized messages', () {
- expect(list[0], "Ran at 00:00:00 on Thursday, January 1, 1970");
- expect(list[1], "Ausgedruckt am 00:00:00 am Donnerstag, 1. Januar 1970.");
- expect(list[2], "วิ่ง 0:00:00 on วันพฤหัสบดี 1 มกราคม 1970.");
- expect(list[3], "วิ่ง now on today.");
+ expect(list[0], "Ran at 00:00:00 on Thursday, January 1, 1970");
+ expect(list[1], "Ausgedruckt am 00:00:00 am Donnerstag, 1. Januar 1970.");
+ expect(list[2], "วิ่ง 0:00:00 on วันพฤหัสบดี 1 มกราคม 1970.");
+ expect(list[3], "วิ่ง now on today.");
});
-}
+}
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698