| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.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 pub_tests; | 5 library pub_tests; |
| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 _webSocket.close(); | 143 _webSocket.close(); |
| 144 _webSocket = null; | 144 _webSocket = null; |
| 145 _webSocketBroadcastStream = null; | 145 _webSocketBroadcastStream = null; |
| 146 } | 146 } |
| 147 }); | 147 }); |
| 148 | 148 |
| 149 if (shouldGetFirst) { | 149 if (shouldGetFirst) { |
| 150 _pubServer.stdout.expect(consumeThrough("Got dependencies!")); | 150 _pubServer.stdout.expect(consumeThrough("Got dependencies!")); |
| 151 } | 151 } |
| 152 | 152 |
| 153 _pubServer.stdout.expect(startsWith("Loading source assets...")); |
| 154 _pubServer.stdout.expect(consumeWhile(matches("Loading .* transformers..."))); |
| 155 |
| 153 // The server should emit one or more ports. | 156 // The server should emit one or more ports. |
| 154 _pubServer.stdout.expect( | 157 _pubServer.stdout.expect( |
| 155 consumeWhile(predicate(_parsePort, 'emits server url'))); | 158 consumeWhile(predicate(_parsePort, 'emits server url'))); |
| 156 schedule(() { | 159 schedule(() { |
| 157 expect(_ports, isNot(isEmpty)); | 160 expect(_ports, isNot(isEmpty)); |
| 158 _portsCompleter.complete(); | 161 _portsCompleter.complete(); |
| 159 }); | 162 }); |
| 160 | 163 |
| 161 return _pubServer; | 164 return _pubServer; |
| 162 } | 165 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 /// included. Unlike [getServerUrl], this should only be called after the ports | 330 /// included. Unlike [getServerUrl], this should only be called after the ports |
| 328 /// are known. | 331 /// are known. |
| 329 String _getServerUrlSync([String root, String path]) { | 332 String _getServerUrlSync([String root, String path]) { |
| 330 if (root == null) root = 'web'; | 333 if (root == null) root = 'web'; |
| 331 expect(_ports, contains(root)); | 334 expect(_ports, contains(root)); |
| 332 var url = "http://127.0.0.1:${_ports[root]}"; | 335 var url = "http://127.0.0.1:${_ports[root]}"; |
| 333 if (path != null) url = "$url/$path"; | 336 if (path != null) url = "$url/$path"; |
| 334 return url; | 337 return url; |
| 335 } | 338 } |
| 336 | 339 |
| OLD | NEW |