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

Side by Side Diff: test/lish/utils.dart

Issue 1153643002: Use "package:" imports for pub. (Closed) Base URL: git@github.com:dart-lang/pub_test@master
Patch Set: Code review changes Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library lish.utils; 5 library lish.utils;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:pub/src/io.dart';
9 import 'package:scheduled_test/scheduled_test.dart'; 10 import 'package:scheduled_test/scheduled_test.dart';
10 import 'package:scheduled_test/scheduled_server.dart'; 11 import 'package:scheduled_test/scheduled_server.dart';
11 import 'package:shelf/shelf.dart' as shelf; 12 import 'package:shelf/shelf.dart' as shelf;
12 13
13 import '../../lib/src/io.dart';
14 14
15 void handleUploadForm(ScheduledServer server, [Map body]) { 15 void handleUploadForm(ScheduledServer server, [Map body]) {
16 server.handle('GET', '/api/packages/versions/new', (request) { 16 server.handle('GET', '/api/packages/versions/new', (request) {
17 return server.url.then((url) { 17 return server.url.then((url) {
18 expect(request.headers, 18 expect(request.headers,
19 containsPair('authorization', 'Bearer access token')); 19 containsPair('authorization', 'Bearer access token'));
20 20
21 if (body == null) { 21 if (body == null) {
22 body = { 22 body = {
23 'url': url.resolve('/upload').toString(), 23 'url': url.resolve('/upload').toString(),
(...skipping 13 matching lines...) Expand all
37 void handleUpload(ScheduledServer server) { 37 void handleUpload(ScheduledServer server) {
38 server.handle('POST', '/upload', (request) { 38 server.handle('POST', '/upload', (request) {
39 // TODO(nweiz): Once a multipart/form-data parser in Dart exists, validate 39 // TODO(nweiz): Once a multipart/form-data parser in Dart exists, validate
40 // that the request body is correctly formatted. See issue 6952. 40 // that the request body is correctly formatted. See issue 6952.
41 return drainStream(request.read()) 41 return drainStream(request.read())
42 .then((_) => server.url) 42 .then((_) => server.url)
43 .then((url) => new shelf.Response.found(url.resolve('/create'))); 43 .then((url) => new shelf.Response.found(url.resolve('/create')));
44 }); 44 });
45 } 45 }
46 46
OLDNEW
« no previous file with comments | « test/lish/server_arg_does_not_override_private_test.dart ('k') | test/list_package_dirs/ignores_updated_pubspec_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698