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

Unified Diff: test/runner/browser/runner_test.dart

Issue 1086213002: Support a @Timeout annotation. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: CHANGELOG + README Created 5 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
« no previous file with comments | « pubspec.yaml ('k') | test/runner/isolate_listener_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/browser/runner_test.dart
diff --git a/test/runner/browser/runner_test.dart b/test/runner/browser/runner_test.dart
index 80f9774eefc82df5a18511c07a3ff6138c2514f3..97d779ab86b24b41a419a5c3b53a9aea44ab1f17 100644
--- a/test/runner/browser/runner_test.dart
+++ b/test/runner/browser/runner_test.dart
@@ -258,6 +258,24 @@ void main() {
expect(result.stdout, contains("Hello,\nworld!\n"));
expect(result.exitCode, equals(0));
});
+
+ test("respects top-level @Timeout declarations", () {
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync('''
+@Timeout(const Duration(seconds: 0))
+
+import 'dart:async';
+
+import 'package:test/test.dart';
+
+void main() {
+ test("timeout", () {});
+}
+''');
+
+ var result = _runUnittest(["-p", "chrome", "test.dart"]);
+ expect(result.stdout, contains("Test timed out after 0 seconds."));
+ expect(result.stdout, contains("-1: Some tests failed."));
+ });
}
ProcessResult _runUnittest(List<String> args) =>
« no previous file with comments | « pubspec.yaml ('k') | test/runner/isolate_listener_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698