Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(938)

Unified Diff: sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_request_asset_test.dart

Issue 221173007: Properly handle web socket requests to half-initialized servers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_request_asset_test.dart
diff --git a/sdk/lib/_internal/pub/test/serve/web_socket/unserve_directory_test.dart b/sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_request_asset_test.dart
similarity index 54%
copy from sdk/lib/_internal/pub/test/serve/web_socket/unserve_directory_test.dart
copy to sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_request_asset_test.dart
index f9446d95eaf2d1eb83f1ce575b0f6d057d383be5..cc6ecd4a5200113ef8a328ae23130edc5b61d5b1 100644
--- a/sdk/lib/_internal/pub/test/serve/web_socket/unserve_directory_test.dart
+++ b/sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_request_asset_test.dart
@@ -4,13 +4,16 @@
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("unbinds a directory from a port", () {
+ integration("binds a directory to a new port and immediately requests an "
+ "asset URL from that server", () {
d.dir(appPath, [
d.appPubspec(),
d.dir("test", [
@@ -21,22 +24,15 @@ main() {
])
]).create();
- pubServe();
+ pubServe(args: ["web"]);
- requestShouldSucceed("index.html", "<body>");
- requestShouldSucceed("index.html", "<test body>", root: "test");
+ // Bind the new directory.
+ expect(webSocketRequest("serveDirectory", {"path": "test"}), completes);
- // Unbind the directory.
- expectWebSocketResult("unserveDirectory", {"path": "test"}, {
- "url": getServerUrl("test")
+ expectWebSocketResult("pathToUrls", {"path": "test/index.html"}, {
+ "urls": [endsWith("/index.html")]
});
- // "test" should not be served now.
- requestShouldNotConnect("index.html", root: "test");
-
- // "web" is still fine.
- requestShouldSucceed("index.html", "<body>");
-
endPubServe();
});
}

Powered by Google App Engine
This is Rietveld 408576698