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

Unified Diff: lib/src/backend/invoker.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 | « lib/pub_serve.dart ('k') | lib/src/backend/metadata.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/invoker.dart
diff --git a/lib/src/backend/invoker.dart b/lib/src/backend/invoker.dart
index 147741ffae9aa17265e8394cbc19c7f1ac82af99..2ff1772586e65839d88e5f71b615637a1b6fe097 100644
--- a/lib/src/backend/invoker.dart
+++ b/lib/src/backend/invoker.dart
@@ -67,6 +67,9 @@ class Invoker {
/// The test being run.
LocalTest get _test => liveTest.test as LocalTest;
+ /// The test metadata merged with the suite metadata.
+ final Metadata metadata;
+
/// Note that this is meaningless once [_onCompleteCompleter] is complete.
var _outstandingCallbacks = 0;
@@ -84,7 +87,8 @@ class Invoker {
return Zone.current[#test.invoker];
}
- Invoker._(Suite suite, LocalTest test) {
+ Invoker._(Suite suite, LocalTest test)
+ : metadata = suite.metadata.merge(test.metadata) {
_controller = new LiveTestController(suite, test, _onRun, () {
_closed = true;
});
@@ -158,7 +162,7 @@ class Invoker {
// TODO(nweiz): Make the timeout configurable.
// TODO(nweiz): Reset this timer whenever the user's code interacts with
// the library.
- var timeout = _test.metadata.timeout.apply(new Duration(seconds: 30));
+ var timeout = metadata.timeout.apply(new Duration(seconds: 30));
var timer = new Timer(timeout, () {
if (liveTest.isComplete) return;
handleError(
« no previous file with comments | « lib/pub_serve.dart ('k') | lib/src/backend/metadata.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698