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

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

Issue 14297021: Move pub into sdk/lib/_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disallow package: imports of pub. Created 7 years, 8 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 oauth2.utils; 5 library oauth2.utils;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:json' as json; 8 import 'dart:json' as json;
9 import 'dart:uri'; 9 import 'dart:uri';
10 10
11 import 'package:http/http.dart' as http; 11 import 'package:http/http.dart' as http;
12 import 'package:scheduled_test/scheduled_process.dart'; 12 import 'package:scheduled_test/scheduled_process.dart';
13 import 'package:scheduled_test/scheduled_test.dart'; 13 import 'package:scheduled_test/scheduled_test.dart';
14 import 'package:scheduled_test/scheduled_server.dart'; 14 import 'package:scheduled_test/scheduled_server.dart';
15 15
16 import '../../../pub/io.dart'; 16 import '../../lib/src/io.dart';
17 import '../../../pub/utils.dart'; 17 import '../../lib/src/utils.dart';
18 import '../test_pub.dart'; 18 import '../test_pub.dart';
19 19
20 void authorizePub(ScheduledProcess pub, ScheduledServer server, 20 void authorizePub(ScheduledProcess pub, ScheduledServer server,
21 [String accessToken="access token"]) { 21 [String accessToken="access token"]) {
22 // TODO(rnystrom): The confirm line is run together with this one because 22 // TODO(rnystrom): The confirm line is run together with this one because
23 // in normal usage, the user will have entered a newline on stdin which 23 // in normal usage, the user will have entered a newline on stdin which
24 // gets echoed to the terminal. Do something better here? 24 // gets echoed to the terminal. Do something better here?
25 expect(pub.nextLine(), completion(equals( 25 expect(pub.nextLine(), completion(equals(
26 'Looks great! Are you ready to upload your package (y/n)? ' 26 'Looks great! Are you ready to upload your package (y/n)? '
27 'Pub needs your authorization to upload packages on your behalf.'))); 27 'Pub needs your authorization to upload packages on your behalf.')));
(...skipping 25 matching lines...) Expand all
53 new ContentType("application", "json"); 53 new ContentType("application", "json");
54 request.response.write(json.stringify({ 54 request.response.write(json.stringify({
55 "access_token": accessToken, 55 "access_token": accessToken,
56 "token_type": "bearer" 56 "token_type": "bearer"
57 })); 57 }));
58 request.response.close(); 58 request.response.close();
59 }); 59 });
60 }); 60 });
61 } 61 }
62 62
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698