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

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

Issue 1657613003: Eagerly close browser tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 11 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.dart ('k') | lib/src/runner/loader.dart » ('j') | 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 730262edf04658ecd8ea2afa47511e85076dc081..62085162adfb83410f4225d5f831223b7237eec1 100644
--- a/lib/src/runner/browser/server.dart
+++ b/lib/src/runner/browser/server.dart
@@ -385,6 +385,20 @@ void main() {
return future;
}
+ /// Close all the browsers that the server currently has open.
+ ///
+ /// Note that this doesn't close the server itself. Browser tests can still be
+ /// loaded, they'll just spawn new browsers.
+ Future closeBrowsers() {
+ var managers = _browserManagers.values.toList();
+ _browserManagers.clear();
+ return Future.wait(managers.map((manager) async {
+ var result = await manager;
+ if (result.isError) return;
+ await result.asValue.value.close();
+ }));
+ }
+
/// Closes the server and releases all its resources.
///
/// Returns a [Future] that completes once the server is closed and its
« no previous file with comments | « lib/src/runner.dart ('k') | lib/src/runner/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698