| Index: dart/pkg/unittest/lib/unittest.dart
|
| diff --git a/dart/pkg/unittest/lib/unittest.dart b/dart/pkg/unittest/lib/unittest.dart
|
| index f3b4e44119d347100b316b2b9b2476e520d4b3ac..e5923f3979f5e0c115d10996c42ea433254d29c4 100644
|
| --- a/dart/pkg/unittest/lib/unittest.dart
|
| +++ b/dart/pkg/unittest/lib/unittest.dart
|
| @@ -753,14 +753,16 @@ void _runTest() {
|
| final testCase = testCases[_currentTestCaseIndex];
|
| var f = _guardAsync(testCase._run, null, testCase);
|
| Timer timer;
|
| - try {
|
| - final Duration timeout = unittestConfiguration.timeout;
|
| - timer = new Timer(timeout, () {
|
| - testCase.error("Test timed out after ${timeout.inSeconds} seconds.");
|
| - });
|
| - } on UnsupportedError catch (e) {
|
| - if (e.message != "Timer greater than 0.") rethrow;
|
| - // Support running on d8 and jsshell which don't support timers.
|
| + final Duration timeout = unittestConfiguration.timeout;
|
| + if (timeout != null) {
|
| + try {
|
| + timer = new Timer(timeout, () {
|
| + testCase.error("Test timed out after ${timeout.inSeconds} seconds.");
|
| + });
|
| + } on UnsupportedError catch (e) {
|
| + if (e.message != "Timer greater than 0.") rethrow;
|
| + // Support running on d8 and jsshell which don't support timers.
|
| + }
|
| }
|
| f.whenComplete(() {
|
| if (timer != null) timer.cancel();
|
|
|