| 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..327dc18a0b7bf33cb0d9422ed7d4033b3e5d8830 100644
|
| --- a/tests/lib/async/timer_test.dart
|
| +++ b/tests/lib/async/timer_test.dart
|
| @@ -15,9 +15,14 @@ int startTime;
|
| int timeout;
|
| int iteration;
|
|
|
| +// Some browsers (Firefox and IE so far) can trigger too early. Add a safety
|
| +// margin. We use identical(1, 1.0) as an easy way to know if the test is
|
| +// compiled by dart2js.
|
| +int get safetyMargin => identical(1, 1.0) ? 0 : 100;
|
| +
|
| void timeoutHandler() {
|
| int endTime = (new DateTime.now()).millisecondsSinceEpoch;
|
| - expect(endTime - startTime, greaterThanOrEqualTo(timeout));
|
| + expect(endTime - startTime + safetyMargin, greaterThanOrEqualTo(timeout));
|
| if (iteration < ITERATIONS) {
|
| iteration++;
|
| timeout = timeout - DECREASE;
|
|
|