| Index: sdk/lib/_internal/pub/test/serve/utils.dart
|
| diff --git a/sdk/lib/_internal/pub/test/serve/utils.dart b/sdk/lib/_internal/pub/test/serve/utils.dart
|
| index eb412a796750904d53aa3a06e65c95580664d80f..b57a984c9f5779e26d73bfe5043aa1b22fb0a65a 100644
|
| --- a/sdk/lib/_internal/pub/test/serve/utils.dart
|
| +++ b/sdk/lib/_internal/pub/test/serve/utils.dart
|
| @@ -92,17 +92,15 @@ class DartTransformer extends Transformer {
|
| """;
|
| }
|
|
|
| -/// Schedules starting the "pub serve" process.
|
| +/// Schedules starting the `pub serve` process.
|
| ///
|
| -/// If [shouldGetFirst] is `true`, validates that pub get is run first. If
|
| -/// [dart2js] is `false`, does not compile Dart entrypoints in "web" to
|
| -/// JavaScript.
|
| +/// Unlike [pubServe], this doesn't determine the port number of the server, and
|
| +/// so may be used to test for errors in the initialization process.
|
| ///
|
| /// Returns the `pub serve` process.
|
| -ScheduledProcess startPubServe({bool shouldGetFirst: false,
|
| - Iterable<String> args}) {
|
| +ScheduledProcess startPubServe([Iterable<String> args]) {
|
| // Use port 0 to get an ephemeral port.
|
| - var pubArgs = ["serve", "--port=0", "--hostname=127.0.0.1"];
|
| + var pubArgs = ["serve", "--port=0", "--hostname=127.0.0.1", "--force-poll"];
|
|
|
| if (args != null) pubArgs.addAll(args);
|
|
|
| @@ -110,7 +108,18 @@ ScheduledProcess startPubServe({bool shouldGetFirst: false,
|
| // timeout to cope with that.
|
| currentSchedule.timeout = new Duration(seconds: 15);
|
|
|
| - _pubServer = startPub(args: pubArgs);
|
| + return startPub(args: pubArgs);
|
| +}
|
| +
|
| +/// Schedules starting the "pub serve" process and records its port number for
|
| +/// future requests.
|
| +///
|
| +/// If [shouldGetFirst] is `true`, validates that pub get is run first.
|
| +///
|
| +/// Returns the `pub serve` process.
|
| +ScheduledProcess pubServe({bool shouldGetFirst: false,
|
| + Iterable<String> args}) {
|
| + _pubServer = startPubServe(args);
|
|
|
| currentSchedule.onComplete.schedule(() {
|
| if (_webSocket != null) {
|
|
|