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

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

Issue 223183002: Fix pub's web socket serve/unserve test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_unserve_test.dart
diff --git a/sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_unserve_test.dart b/sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_unserve_test.dart
index 1d459cf9c21bfc7f6a1590025cdfde435d8cb025..d8f60e4a23ccd890ab16f052b51ae32ddb0f4606 100644
--- a/sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_unserve_test.dart
+++ b/sdk/lib/_internal/pub/test/serve/web_socket/serve_directory_and_immediately_unserve_test.dart
@@ -28,11 +28,14 @@ main() {
pubServe(args: ["web"]);
+ // We call [webSocketRequest] outside of the [schedule] call below because
+ // we need it to schedule the sending of the request to guarantee that the
+ // serve is sent before the unserve.
+ var serveRequest = webSocketRequest("serveDirectory", {"path": "test"});
+ var unserveRequest = webSocketRequest("unserveDirectory", {"path": "test"});
+
schedule(() {
- return Future.wait([
- webSocketRequest("serveDirectory", {"path": "test"}),
- webSocketRequest("unserveDirectory", {"path": "test"})
- ]).then((results) {
+ return Future.wait([serveRequest, unserveRequest]).then((results) {
expect(results[0], contains("result"));
expect(results[1], contains("result"));
// These results should be equal since "serveDirectory" returns the URL
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698