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

Side by Side Diff: sdk/lib/_internal/pub/test/lish/utils.dart

Issue 16351003: Move pub over to using the pub.dartlang.org API v2. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 6 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
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:io'; 7 import 'dart:io';
8 import 'dart:json' as json; 8 import 'dart:json' as json;
9 9
10 import 'package:scheduled_test/scheduled_test.dart'; 10 import 'package:scheduled_test/scheduled_test.dart';
11 import 'package:scheduled_test/scheduled_server.dart'; 11 import 'package:scheduled_test/scheduled_server.dart';
12 12
13 import '../../lib/src/io.dart'; 13 import '../../lib/src/io.dart';
14 import '../test_pub.dart'; 14 import '../test_pub.dart';
15 15
16 void handleUploadForm(ScheduledServer server, [Map body]) { 16 void handleUploadForm(ScheduledServer server, [Map body]) {
17 server.handle('GET', '/packages/versions/new.json', (request) { 17 server.handle('GET', '/api/packages/versions/new', (request) {
18 return server.url.then((url) { 18 return server.url.then((url) {
19 expect(request.headers.value('authorization'), 19 expect(request.headers.value('authorization'),
20 equals('Bearer access token')); 20 equals('Bearer access token'));
21 21
22 if (body == null) { 22 if (body == null) {
23 body = { 23 body = {
24 'url': url.resolve('/upload').toString(), 24 'url': url.resolve('/upload').toString(),
25 'fields': { 25 'fields': {
26 'field1': 'value1', 26 'field1': 'value1',
27 'field2': 'value2' 27 'field2': 'value2'
(...skipping 17 matching lines...) Expand all
45 return server.url; 45 return server.url;
46 }).then((url) { 46 }).then((url) {
47 request.response.statusCode = 302; 47 request.response.statusCode = 302;
48 request.response.headers.set( 48 request.response.headers.set(
49 'location', url.resolve('/create').toString()); 49 'location', url.resolve('/create').toString());
50 request.response.close(); 50 request.response.close();
51 }); 51 });
52 }); 52 });
53 } 53 }
54 54
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698