| 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.browser_manager; | 5 library test.runner.browser.browser_manager; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:http_parser/http_parser.dart'; | 10 import 'package:http_parser/http_parser.dart'; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 suiteChannel.stream.listen((response) { | 101 suiteChannel.stream.listen((response) { |
| 102 if (response["type"] == "print") { | 102 if (response["type"] == "print") { |
| 103 print(response["line"]); | 103 print(response["line"]); |
| 104 } else { | 104 } else { |
| 105 completer.complete(response); | 105 completer.complete(response); |
| 106 } | 106 } |
| 107 }, onDone: () { | 107 }, onDone: () { |
| 108 if (!completer.isCompleted) completer.complete(); | 108 if (!completer.isCompleted) completer.complete(); |
| 109 }); | 109 }); |
| 110 | 110 |
| 111 return completer.future.timeout(new Duration(seconds: 15), onTimeout: () { | 111 return completer.future.timeout(new Duration(minutes: 1), onTimeout: () { |
| 112 throw new LoadException( | 112 throw new LoadException( |
| 113 path, | 113 path, |
| 114 "Timed out waiting for the test suite to connect on " | 114 "Timed out waiting for the test suite to connect on " |
| 115 "${browser.name}."); | 115 "${browser.name}."); |
| 116 }); | 116 }); |
| 117 }); | 117 }); |
| 118 | 118 |
| 119 if (response == null) { | 119 if (response == null) { |
| 120 closeIframe(); | 120 closeIframe(); |
| 121 return null; | 121 return null; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 135 } | 135 } |
| 136 | 136 |
| 137 return new Suite(response["tests"].map((test) { | 137 return new Suite(response["tests"].map((test) { |
| 138 var testMetadata = new Metadata.deserialize(test['metadata']); | 138 var testMetadata = new Metadata.deserialize(test['metadata']); |
| 139 var testChannel = suiteChannel.virtualChannel(test['channel']); | 139 var testChannel = suiteChannel.virtualChannel(test['channel']); |
| 140 return new IframeTest(test['name'], testMetadata, testChannel, | 140 return new IframeTest(test['name'], testMetadata, testChannel, |
| 141 mapper: mapper); | 141 mapper: mapper); |
| 142 }), metadata: metadata, path: path, onClose: () => closeIframe()); | 142 }), metadata: metadata, path: path, onClose: () => closeIframe()); |
| 143 } | 143 } |
| 144 } | 144 } |
| OLD | NEW |