| Index: sdk/lib/_internal/pub/test/serve/web_socket/unserve_directory_test.dart
|
| diff --git a/sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_test.dart b/sdk/lib/_internal/pub/test/serve/web_socket/unserve_directory_test.dart
|
| similarity index 53%
|
| copy from sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_test.dart
|
| copy to sdk/lib/_internal/pub/test/serve/web_socket/unserve_directory_test.dart
|
| index 876142f0de4a0e3407241ce2ca28e6534fad2709..361bb3f87b579cf75adbfe5c209353ae33eae596 100644
|
| --- a/sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_test.dart
|
| +++ b/sdk/lib/_internal/pub/test/serve/web_socket/unserve_directory_test.dart
|
| @@ -4,15 +4,13 @@
|
|
|
| library pub_tests;
|
|
|
| -import 'package:scheduled_test/scheduled_test.dart';
|
| -
|
| import '../../descriptor.dart' as d;
|
| import '../../test_pub.dart';
|
| import '../utils.dart';
|
|
|
| main() {
|
| initConfig();
|
| - integration("binds a directory to a new port", () {
|
| + integration("unbinds a directory from a port", () {
|
| d.dir(appPath, [
|
| d.appPubspec(),
|
| d.dir("test", [
|
| @@ -23,30 +21,24 @@ main() {
|
| ])
|
| ]).create();
|
|
|
| - pubServe(args: ["web"]);
|
| + pubServe();
|
| +
|
| + requestShouldSucceed("index.html", "<body>");
|
| + requestShouldSucceed("index.html", "<test body>", root: "test");
|
|
|
| - // Bind the new directory.
|
| + // Unbind the directory.
|
| expectWebSocketCall({
|
| - "command": "serveDirectory",
|
| + "command": "unserveDirectory",
|
| "path": "test"
|
| - }, replyMatches: {"url": matches(r"http://127\.0\.0\.1:\d+")})
|
| - .then((response) {
|
| - var url = Uri.parse(response["url"]);
|
| - registerServerPort("test", url.port);
|
| + }, replyEquals: {
|
| + "url": getServerUrl("test")
|
| });
|
|
|
| - // It should be served now.
|
| - requestShouldSucceed("index.html", "<test body>", root: "test");
|
| -
|
| - // And watched.
|
| - d.dir(appPath, [
|
| - d.dir("test", [
|
| - d.file("index.html", "after")
|
| - ])
|
| - ]).create();
|
| + // "test" should not be served now.
|
| + requestShouldNotConnect("index.html", root: "test");
|
|
|
| - waitForBuildSuccess();
|
| - requestShouldSucceed("index.html", "after", root: "test");
|
| + // "web" is still fine.
|
| + requestShouldSucceed("index.html", "<body>");
|
|
|
| endPubServe();
|
| });
|
|
|