Chromium Code Reviews| Index: sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_test.dart |
| diff --git a/sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_test.dart b/sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_test.dart |
| index ce6b6208dff4a1f1d656e01a068faada288f03de..413546a37036a65fd37d583ba1ec99e5529fe092 100644 |
| --- a/sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_test.dart |
| +++ b/sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_test.dart |
| @@ -53,108 +53,91 @@ main() { |
| pubServe(args: ["test", "web", "randomdir"], shouldGetFirst: true); |
| // Paths in web/. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| - "path": p.join("web", "index.html") |
| - }, replyEquals: {"urls": [getServerUrl("web", "index.html")]}); |
| + expectWebSocketCall("pathToUrls", {"path": p.join("web", "index.html")}, |
|
Bob Nystrom
2014/03/21 17:42:25
Just for consistency's sake how about making these
nweiz
2014/03/21 20:27:38
Done.
|
| + result: {"urls": [getServerUrl("web", "index.html")]}); |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| + expectWebSocketCall("pathToUrls", { |
| "path": p.join("web", "sub", "bar.html") |
| - }, replyEquals: {"urls": [getServerUrl("web", "sub/bar.html")]}); |
| + }, result: {"urls": [getServerUrl("web", "sub/bar.html")]}); |
| // Paths in test/. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| - "path": p.join("test", "index.html") |
| - }, replyEquals: {"urls": [getServerUrl("test", "index.html")]}); |
| + expectWebSocketCall("pathToUrls", {"path": p.join("test", "index.html")}, |
| + result: {"urls": [getServerUrl("test", "index.html")]}); |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| + expectWebSocketCall("pathToUrls", { |
| "path": p.join("test", "sub", "bar.html") |
| - }, replyEquals: {"urls": [getServerUrl("test", "sub/bar.html")]}); |
| + }, result: {"urls": [getServerUrl("test", "sub/bar.html")]}); |
| // A non-default directory. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| + expectWebSocketCall("pathToUrls", { |
| "path": p.join("randomdir", "index.html") |
| - }, replyEquals: {"urls": [getServerUrl("randomdir", "index.html")]}); |
| + }, result: {"urls": [getServerUrl("randomdir", "index.html")]}); |
| // A path in lib/. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| - "path": p.join("lib", "app.dart") |
| - }, replyEquals: {"urls": [ |
| + expectWebSocketCall("pathToUrls", {"path": p.join("lib", "app.dart")}, |
| + result: {"urls": [ |
| getServerUrl("test", "packages/myapp/app.dart"), |
| getServerUrl("web", "packages/myapp/app.dart"), |
| getServerUrl("randomdir", "packages/myapp/app.dart") |
| ]}); |
| // A path in asset/. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| - "path": p.join("asset", "app.txt") |
| - }, replyEquals: {"urls": [ |
| + expectWebSocketCall("pathToUrls", {"path": p.join("asset", "app.txt")}, |
| + result: {"urls": [ |
| getServerUrl("test", "assets/myapp/app.txt"), |
| getServerUrl("web", "assets/myapp/app.txt"), |
| getServerUrl("randomdir", "assets/myapp/app.txt") |
| ]}); |
| // A path to this package in packages/. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| + expectWebSocketCall("pathToUrls", { |
| "path": p.join("packages", "myapp", "app.dart") |
| - }, replyEquals: {"urls": [ |
| + }, result: {"urls": [ |
| getServerUrl("test", "packages/myapp/app.dart"), |
| getServerUrl("web", "packages/myapp/app.dart"), |
| getServerUrl("randomdir", "packages/myapp/app.dart") |
| ]}); |
| // A path to another package in packages/. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| + expectWebSocketCall("pathToUrls", { |
| "path": p.join("packages", "foo", "foo.dart") |
| - }, replyEquals: {"urls": [ |
| + }, result: {"urls": [ |
| getServerUrl("test", "packages/foo/foo.dart"), |
| getServerUrl("web", "packages/foo/foo.dart"), |
| getServerUrl("randomdir", "packages/foo/foo.dart") |
| ]}); |
| // A relative path to another package's lib/ directory. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| + expectWebSocketCall("pathToUrls", { |
| "path": p.join("..", "foo", "lib", "foo.dart") |
| - }, replyEquals: {"urls": [ |
| + }, result: {"urls": [ |
| getServerUrl("test", "packages/foo/foo.dart"), |
| getServerUrl("web", "packages/foo/foo.dart"), |
| getServerUrl("randomdir", "packages/foo/foo.dart") |
| ]}); |
| // An absolute path to another package's lib/ directory. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| + expectWebSocketCall("pathToUrls", { |
| "path": p.join(sandboxDir, "foo", "lib", "foo.dart") |
| - }, replyEquals: {"urls": [ |
| + }, result: {"urls": [ |
| getServerUrl("test", "packages/foo/foo.dart"), |
| getServerUrl("web", "packages/foo/foo.dart"), |
| getServerUrl("randomdir", "packages/foo/foo.dart") |
| ]}); |
| // A relative path to another package's asset/ directory. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| + expectWebSocketCall("pathToUrls", { |
| "path": p.join("..", "foo", "asset", "foo.dart") |
| - }, replyEquals: {"urls": [ |
| + }, result: {"urls": [ |
| getServerUrl("test", "assets/foo/foo.dart"), |
| getServerUrl("web", "assets/foo/foo.dart"), |
| getServerUrl("randomdir", "assets/foo/foo.dart") |
| ]}); |
| // An absolute path to another package's asset/ directory. |
| - expectWebSocketCall({ |
| - "command": "pathToUrls", |
| + expectWebSocketCall("pathToUrls", { |
| "path": p.join(sandboxDir, "foo", "asset", "foo.dart") |
| - }, replyEquals: {"urls": [ |
| + }, result: {"urls": [ |
| getServerUrl("test", "assets/foo/foo.dart"), |
| getServerUrl("web", "assets/foo/foo.dart"), |
| getServerUrl("randomdir", "assets/foo/foo.dart") |