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

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

Issue 1098703003: Add timeouts for browser connections. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: 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/src/runner/browser/browser_manager.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/server.dart
diff --git a/lib/src/runner/browser/server.dart b/lib/src/runner/browser/server.dart
index cdec66d7b7b3375b4f8b0d3e76b7e16c13f10027..007ebba54b306136585e3c792929106cbc86322e 100644
--- a/lib/src/runner/browser/server.dart
+++ b/lib/src/runner/browser/server.dart
@@ -22,6 +22,7 @@ import '../../util/io.dart';
import '../../util/path_handler.dart';
import '../../util/one_off_handler.dart';
import '../../utils.dart';
+import '../application_exception.dart';
import '../load_exception.dart';
import 'browser.dart';
import 'browser_manager.dart';
@@ -357,7 +358,10 @@ void main() {
completer.completeError(error, stackTrace);
});
- return completer.future;
+ return completer.future.timeout(new Duration(seconds: 7), onTimeout: () {
+ throw new ApplicationException(
+ "Timed out waiting for ${platform.name} to connect.");
+ });
}
/// Starts the browser identified by [browser] and has it load [url].
« no previous file with comments | « lib/src/runner/browser/browser_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698