| Index: tests/lib/async/timer_test.dart
|
| diff --git a/tests/lib/async/timer_test.dart b/tests/lib/async/timer_test.dart
|
| index 89b38ece5d7adbd847acca084a7aa84356c5bf3a..d82f2266ca93c6710ec7c002870519834cf2e9d8 100644
|
| --- a/tests/lib/async/timer_test.dart
|
| +++ b/tests/lib/async/timer_test.dart
|
| @@ -15,9 +15,15 @@ int startTime;
|
| int timeout;
|
| int iteration;
|
|
|
| +// Easy way to know if the test is compiled by dart2js.
|
| +bool get isCompiledByDart2Js => identical(1, 1.0);
|
| +
|
| void timeoutHandler() {
|
| int endTime = (new DateTime.now()).millisecondsSinceEpoch;
|
| - expect(endTime - startTime, greaterThanOrEqualTo(timeout));
|
| + // Some browsers (Firefox and IE so far) can trigger too early. Add a safety
|
| + // margin.
|
| + int safetyMargin = isCompiledByDart2Js ? 100 : 0;
|
| + expect(endTime - startTime + safetyMargin, greaterThanOrEqualTo(timeout));
|
| if (iteration < ITERATIONS) {
|
| iteration++;
|
| timeout = timeout - DECREASE;
|
|
|