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

Side by Side Diff: lib/src/runner/browser/server.dart

Issue 1091883002: More gracefully handle browser errors. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: merge 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 unified diff | Download patch
« no previous file with comments | « lib/src/runner/browser/safari.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.runner.browser.server; 5 library test.runner.browser.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 .then((_) { 259 .then((_) {
260 if (_closed) return null; 260 if (_closed) return null;
261 return url.resolveUri(p.toUri( 261 return url.resolveUri(p.toUri(
262 p.withoutExtension(p.relative(path, from: _root)) + ".html")); 262 p.withoutExtension(p.relative(path, from: _root)) + ".html"));
263 }); 263 });
264 }).then((suiteUrl) { 264 }).then((suiteUrl) {
265 if (_closed) return null; 265 if (_closed) return null;
266 266
267 // TODO(nweiz): Don't start the browser until all the suites are compiled. 267 // TODO(nweiz): Don't start the browser until all the suites are compiled.
268 return _browserManagerFor(browser).then((browserManager) { 268 return _browserManagerFor(browser).then((browserManager) {
269 if (_closed) return null; 269 if (_closed || browserManager == null) return null;
270 return browserManager.loadSuite(path, suiteUrl, metadata); 270 return browserManager.loadSuite(path, suiteUrl, metadata);
271 }).then((suite) { 271 }).then((suite) {
272 if (_closed) return null; 272 if (_closed) return null;
273 if (suite != null) return suite.change(platform: browser.name); 273 if (suite != null) return suite.change(platform: browser.name);
274 274
275 // If the browser manager fails to load a suite and the server isn't 275 // If the browser manager fails to load a suite and the server isn't
276 // closed, it's probably because the browser failed. We emit the failure 276 // closed, it's probably because the browser failed. We emit the failure
277 // here to ensure that it gets surfaced. 277 // here to ensure that it gets surfaced.
278 return _browsers[browser].onExit; 278 return _browsers[browser].onExit;
279 }); 279 });
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 if (_pubServeUrl == null) { 413 if (_pubServeUrl == null) {
414 new Directory(_compiledDir).deleteSync(recursive: true); 414 new Directory(_compiledDir).deleteSync(recursive: true);
415 } else { 415 } else {
416 _http.close(); 416 _http.close();
417 } 417 }
418 418
419 _closeCompleter.complete(); 419 _closeCompleter.complete();
420 }).catchError(_closeCompleter.completeError); 420 }).catchError(_closeCompleter.completeError);
421 } 421 }
422 } 422 }
OLDNEW
« no previous file with comments | « lib/src/runner/browser/safari.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698