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

Side by Side Diff: sdk/lib/_internal/pub_generated/test/serve/web_socket/path_to_urls_errors_test.dart

Issue 557563002: Store the async-await compiled pub code directly in the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 library pub_tests;
2 import 'package:json_rpc_2/error_code.dart' as rpc_error_code;
3 import 'package:path/path.dart' as p;
4 import '../../descriptor.dart' as d;
5 import '../../test_pub.dart';
6 import '../utils.dart';
7 main() {
8 initConfig();
9 integration("pathToUrls errors on bad inputs", () {
10 d.dir(
11 "foo",
12 [
13 d.libPubspec("foo", "1.0.0"),
14 d.dir("web", [d.file("foo.txt", "foo")])]).create();
15 d.dir(appPath, [d.appPubspec({
16 "foo": {
17 "path": "../foo"
18 }
19 }),
20 d.file("top-level.txt", "top-level"),
21 d.dir("bin", [d.file("foo.txt", "foo")]),
22 d.dir("lib", [d.file("myapp.dart", "myapp")])]).create();
23 pubServe(shouldGetFirst: true);
24 expectWebSocketError("pathToUrls", {
25 "path": 123
26 },
27 rpc_error_code.INVALID_PARAMS,
28 'Parameter "path" for method "pathToUrls" must be a string, but was ' '1 23.');
29 expectWebSocketError("pathToUrls", {
30 "path": "main.dart",
31 "line": 12.34
32 },
33 rpc_error_code.INVALID_PARAMS,
34 'Parameter "line" for method "pathToUrls" must be an integer, but was '
35 '12.34.');
36 expectNotServed(p.join('bin', 'foo.txt'));
37 expectNotServed(p.join('nope', 'foo.txt'));
38 expectNotServed(p.join("..", "bar", "lib", "bar.txt"));
39 expectNotServed(p.join("..", "foo", "web", "foo.txt"));
40 endPubServe();
41 });
42 }
43 void expectNotServed(String path) {
44 expectWebSocketError("pathToUrls", {
45 "path": path
46 }, NOT_SERVED, 'Asset path "$path" is not currently being served.');
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698