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 |
11 import 'package:http/http.dart' as http; | 11 import 'package:http/http.dart' as http; |
12 import 'package:pub/src/utils.dart'; | 12 import 'package:pub/src/utils.dart'; |
13 import 'package:scheduled_test/scheduled_process.dart'; | 13 import 'package:scheduled_test/scheduled_process.dart'; |
14 import 'package:scheduled_test/scheduled_stream.dart'; | 14 import 'package:scheduled_test/scheduled_stream.dart'; |
15 import 'package:scheduled_test/scheduled_test.dart'; | 15 import 'package:scheduled_test/scheduled_test.dart'; |
16 import 'package:stack_trace/stack_trace.dart'; | |
17 | 16 |
18 import '../descriptor.dart' as d; | 17 import '../descriptor.dart' as d; |
19 import '../test_pub.dart'; | 18 import '../test_pub.dart'; |
20 | 19 |
21 /// The pub process running "pub serve". | 20 /// The pub process running "pub serve". |
22 ScheduledProcess _pubServer; | 21 ScheduledProcess _pubServer; |
23 | 22 |
24 /// The ephemeral port assign to the running admin server. | 23 /// The ephemeral port assign to the running admin server. |
25 int _adminPort; | 24 int _adminPort; |
26 | 25 |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 /// included. Unlike [getServerUrl], this should only be called after the ports | 478 /// included. Unlike [getServerUrl], this should only be called after the ports |
480 /// are known. | 479 /// are known. |
481 String _getServerUrlSync([String root, String path]) { | 480 String _getServerUrlSync([String root, String path]) { |
482 if (root == null) root = 'web'; | 481 if (root == null) root = 'web'; |
483 expect(_ports, contains(root)); | 482 expect(_ports, contains(root)); |
484 var url = "http://localhost:${_ports[root]}"; | 483 var url = "http://localhost:${_ports[root]}"; |
485 if (path != null) url = "$url/$path"; | 484 if (path != null) url = "$url/$path"; |
486 return url; | 485 return url; |
487 } | 486 } |
488 | 487 |
OLD | NEW |