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

Unified Diff: lib/src/runner/browser/iframe_test.dart

Issue 1056733002: Run test tearDowns and clean up temporary directories when a signal is caught. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: changes Created 5 years, 9 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
Index: lib/src/runner/browser/iframe_test.dart
diff --git a/lib/src/runner/browser/iframe_test.dart b/lib/src/runner/browser/iframe_test.dart
index 6b663ab1999163750a977b951fee532e8f9666b0..d17310074287116a3fa7d164bcafc9e2d277f9e7 100644
--- a/lib/src/runner/browser/iframe_test.dart
+++ b/lib/src/runner/browser/iframe_test.dart
@@ -4,6 +4,8 @@
library test.runner.browser.iframe_test;
+import 'dart:async';
+
import '../../backend/live_test.dart';
import '../../backend/live_test_controller.dart';
import '../../backend/metadata.dart';
@@ -25,10 +27,12 @@ class IframeTest implements Test {
LiveTest load(Suite suite) {
var controller;
+ var testChannel;
+ var closeCompleter = new Completer();
kevmoo 2015/04/03 00:49:45 This seems to not be used?
nweiz 2015/04/03 20:56:21 Done.
controller = new LiveTestController(suite, this, () {
controller.setState(const State(Status.running, Result.success));
- var testChannel = _channel.virtualChannel();
+ testChannel = _channel.virtualChannel();
_channel.sink.add({
'command': 'run',
'channel': testChannel.id
@@ -50,6 +54,12 @@ class IframeTest implements Test {
controller.completer.complete();
}
});
+ }, () {
+ // Ignore all future messages from the test and complete it immediately.
+ // We don't need to tell it to run its tear-down because there's nothing a
+ // browser test needs to clean up on the file system anyway.
+ testChannel.sink.close();
+ if (!controller.completer.isCompleted) controller.completer.complete();
});
return controller.liveTest;
}

Powered by Google App Engine
This is Rietveld 408576698