OLD | NEW |
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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 // tests complete. | 439 // tests complete. |
440 browser.onExit.then((_) { | 440 browser.onExit.then((_) { |
441 if (completer.isCompleted) return; | 441 if (completer.isCompleted) return; |
442 if (!_closed) return; | 442 if (!_closed) return; |
443 completer.complete(null); | 443 completer.complete(null); |
444 }).catchError((error, stackTrace) { | 444 }).catchError((error, stackTrace) { |
445 if (completer.isCompleted) return; | 445 if (completer.isCompleted) return; |
446 completer.completeError(error, stackTrace); | 446 completer.completeError(error, stackTrace); |
447 }); | 447 }); |
448 | 448 |
449 return completer.future.timeout(new Duration(seconds: 7), onTimeout: () { | 449 return completer.future.timeout(new Duration(seconds: 30), onTimeout: () { |
450 throw new ApplicationException( | 450 throw new ApplicationException( |
451 "Timed out waiting for ${platform.name} to connect."); | 451 "Timed out waiting for ${platform.name} to connect."); |
452 }); | 452 }); |
453 } | 453 } |
454 | 454 |
455 /// Starts the browser identified by [browser] and has it load [url]. | 455 /// Starts the browser identified by [browser] and has it load [url]. |
456 Browser _newBrowser(Uri url, TestPlatform browser) { | 456 Browser _newBrowser(Uri url, TestPlatform browser) { |
457 switch (browser) { | 457 switch (browser) { |
458 case TestPlatform.dartium: return new Dartium(url); | 458 case TestPlatform.dartium: return new Dartium(url); |
459 case TestPlatform.contentShell: return new ContentShell(url); | 459 case TestPlatform.contentShell: return new ContentShell(url); |
(...skipping 21 matching lines...) Expand all Loading... |
481 await Future.wait(futures); | 481 await Future.wait(futures); |
482 | 482 |
483 if (_pubServeUrl == null) { | 483 if (_pubServeUrl == null) { |
484 new Directory(_compiledDir).deleteSync(recursive: true); | 484 new Directory(_compiledDir).deleteSync(recursive: true); |
485 } else { | 485 } else { |
486 _http.close(); | 486 _http.close(); |
487 } | 487 } |
488 }); | 488 }); |
489 } | 489 } |
490 } | 490 } |
OLD | NEW |