| Index: sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_errors_test.dart
|
| diff --git a/sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_errors_test.dart b/sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_errors_test.dart
|
| index ac77a1cc443901029bcc155e2355e3605445b74c..14ed26ad9ee8f18d3ec24be70f2a098f7bba9899 100644
|
| --- a/sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_errors_test.dart
|
| +++ b/sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_errors_test.dart
|
| @@ -4,6 +4,7 @@
|
|
|
| library pub_tests;
|
|
|
| +import 'package:json_rpc_2/error_code.dart' as rpc_error_code;
|
| import 'package:path/path.dart' as p;
|
|
|
| import '../../descriptor.dart' as d;
|
| @@ -38,29 +39,15 @@ main() {
|
| pubServe(shouldGetFirst: true);
|
|
|
| // Bad arguments.
|
| - expectWebSocketCall({
|
| - "command": "pathToUrls"
|
| - }, replyEquals: {
|
| - "code": "BAD_ARGUMENT",
|
| - "error": 'Missing "path" argument.'
|
| - });
|
| + expectWebSocketError("pathToUrls", {"path": 123},
|
| + rpc_error_code.INVALID_PARAMS,
|
| + 'Parameter "path" for method "pathToUrls" must be a string, but was '
|
| + '123.');
|
|
|
| - expectWebSocketCall({
|
| - "command": "pathToUrls",
|
| - "path": 123
|
| - }, replyEquals: {
|
| - "code": "BAD_ARGUMENT",
|
| - "error": '"path" must be a string. Got 123.'
|
| - });
|
| -
|
| - expectWebSocketCall({
|
| - "command": "pathToUrls",
|
| - "path": "main.dart",
|
| - "line": 12.34
|
| - }, replyEquals: {
|
| - "code": "BAD_ARGUMENT",
|
| - "error": '"line" must be an integer. Got 12.34.'
|
| - });
|
| + expectWebSocketError("pathToUrls", {"path": "main.dart", "line": 12.34},
|
| + rpc_error_code.INVALID_PARAMS,
|
| + 'Parameter "line" for method "pathToUrls" must be an integer, but was '
|
| + '12.34.');
|
|
|
| // Unserved directories.
|
| expectNotServed(p.join('bin', 'foo.txt'));
|
| @@ -73,11 +60,6 @@ main() {
|
| }
|
|
|
| void expectNotServed(String path) {
|
| - expectWebSocketCall({
|
| - "command": "pathToUrls",
|
| - "path": path
|
| - }, replyEquals: {
|
| - "code": "NOT_SERVED",
|
| - "error": 'Asset path "$path" is not currently being served.'
|
| - });
|
| + expectWebSocketError("pathToUrls", {"path": path}, NOT_SERVED,
|
| + 'Asset path "$path" is not currently being served.');
|
| }
|
|
|