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

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

Issue 937243002: Revert "Revert "Use native async/await support in pub."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library pub_tests;
6
7 import 'package:json_rpc_2/error_code.dart' as rpc_error_code;
8 import 'package:scheduled_test/scheduled_test.dart';
9
10 import '../../descriptor.dart' as d;
11 import '../../test_pub.dart';
12 import '../utils.dart';
13
14 main() {
15 initConfig();
16
17 setUp(() {
18 d.dir(
19 appPath,
20 [d.appPubspec(), d.dir("web", [d.file("index.html", "<body>")])]).create ();
21 });
22
23 integration("responds with an error if 'path' is not a string", () {
24 pubServe();
25 expectWebSocketError("serveDirectory", {
26 "path": 123
27 },
28 rpc_error_code.INVALID_PARAMS,
29 'Parameter "path" for method "serveDirectory" must be a string, but '
30 'was 123.');
31 endPubServe();
32 });
33
34 integration("responds with an error if 'path' is absolute", () {
35 pubServe();
36 expectWebSocketError("serveDirectory", {
37 "path": "/absolute.txt"
38 },
39 rpc_error_code.INVALID_PARAMS,
40 '"path" must be a relative path. Got "/absolute.txt".');
41 endPubServe();
42 });
43
44 integration("responds with an error if 'path' reaches out", () {
45 pubServe();
46 expectWebSocketError("serveDirectory", {
47 "path": "a/../../bad.txt"
48 },
49 rpc_error_code.INVALID_PARAMS,
50 '"path" cannot reach out of its containing directory. Got '
51 '"a/../../bad.txt".');
52 endPubServe();
53 });
54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698