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

Unified Diff: dart/tools/testing/dart/browser_controller.dart

Issue 660823002: Terminate browsers in sequence. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Bill's comments. Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/testing/dart/browser_controller.dart
diff --git a/dart/tools/testing/dart/browser_controller.dart b/dart/tools/testing/dart/browser_controller.dart
index 493866224db5b390f4624669fa9c1ed6e412d2e9..d17612dbbcaa319b3216420f7173e347c8f8cd28 100644
--- a/dart/tools/testing/dart/browser_controller.dart
+++ b/dart/tools/testing/dart/browser_controller.dart
@@ -1223,20 +1223,29 @@ class BrowserTestRunner {
}
Future<bool> terminate() {
- var futures = [];
+ var browsers = [];
underTermination = true;
testingServer.underTermination = true;
for (BrowserTestingStatus status in browserStatus.values) {
- futures.add(status.browser.close());
+ browsers.add(status.browser);
if (status.nextTestTimeout != null) {
status.nextTestTimeout.cancel();
status.nextTestTimeout = null;
}
}
- return Future.wait(futures).then((values) {
+ // Success if all the browsers closed successfully.
+ bool success = true;
+ Future closeBrowser(Browser b) {
+ return b.close().then((bool closeSucceeded) {
+ if (!closeSucceeded) {
+ success = false;
+ }
+ });
+ }
+ return Future.forEach(browsers, closeBrowser).then((_) {
testingServer.errorReportingServer.close();
printDoubleReportingTests();
- return !values.contains(false);
+ return success;
});
}
@@ -1429,6 +1438,26 @@ class BrowserTestingServer {
String driverContent = """
<!DOCTYPE html><html>
<head>
+ <style>
+ body {
+ margin: 0;
+ }
+ .box {
+ overflow: hidden;
+ overflow-y: auto;
+ position: absolute;
+ left: 0;
+ right: 0;
+ }
+ .controller.box {
+ height: 75px;
+ top: 0;
+ }
+ .test.box {
+ top: 75px;
+ bottom: 0;
+ }
+ </style>
<title>Driving page</title>
<script type='text/javascript'>
var STATUS_UPDATE_INTERVAL = 10000;
@@ -1710,10 +1739,14 @@ class BrowserTestingServer {
</script>
</head>
<body onload="startTesting()">
- Dart test driver, number of tests: <div id="number"></div><br>
- Currently executing: <div id="currently_executing"></div><br>
- Unhandled error: <div id="unhandled_error"></div>
- <iframe id="embedded_iframe"></iframe>
+ <div class="controller box">
+ Dart test driver, number of tests: <span id="number"></span><br>
+ Currently executing: <span id="currently_executing"></span><br>
+ Unhandled error: <span id="unhandled_error"></span>
+ </div>
+ <div class="test box">
+ <iframe style="width:100%;height:100%;" id="embedded_iframe"></iframe>
+ </div>
</body>
</html>
""";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698