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

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

Issue 22941002: Remove unused imports in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 7 years, 4 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 9
10 import 'package:http/http.dart' as http; 10 import 'package:http/http.dart' as http;
11 import 'package:scheduled_test/scheduled_process.dart'; 11 import 'package:scheduled_test/scheduled_process.dart';
12 import 'package:scheduled_test/scheduled_test.dart'; 12 import 'package:scheduled_test/scheduled_test.dart';
13 import 'package:scheduled_test/scheduled_server.dart'; 13 import 'package:scheduled_test/scheduled_server.dart';
14 14
15 import '../../lib/src/io.dart'; 15 import '../../lib/src/io.dart';
16 import '../../lib/src/utils.dart'; 16 import '../../lib/src/utils.dart';
17 import '../test_pub.dart';
18 17
19 void authorizePub(ScheduledProcess pub, ScheduledServer server, 18 void authorizePub(ScheduledProcess pub, ScheduledServer server,
20 [String accessToken="access token"]) { 19 [String accessToken="access token"]) {
21 expect(pub.nextLine(), completion(equals('Pub needs your authorization to ' 20 expect(pub.nextLine(), completion(equals('Pub needs your authorization to '
22 'upload packages on your behalf.'))); 21 'upload packages on your behalf.')));
23 22
24 expect(pub.nextLine().then((line) { 23 expect(pub.nextLine().then((line) {
25 var match = new RegExp(r'[?&]redirect_uri=([0-9a-zA-Z%+-]+)[$&]') 24 var match = new RegExp(r'[?&]redirect_uri=([0-9a-zA-Z%+-]+)[$&]')
26 .firstMatch(line); 25 .firstMatch(line);
27 expect(match, isNotNull); 26 expect(match, isNotNull);
(...skipping 20 matching lines...) Expand all
48 new ContentType("application", "json"); 47 new ContentType("application", "json");
49 request.response.write(json.stringify({ 48 request.response.write(json.stringify({
50 "access_token": accessToken, 49 "access_token": accessToken,
51 "token_type": "bearer" 50 "token_type": "bearer"
52 })); 51 }));
53 request.response.close(); 52 request.response.close();
54 }); 53 });
55 }); 54 });
56 } 55 }
57 56
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698