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

Side by Side Diff: test/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart

Issue 1215833002: Use the new test runner. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 5 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) 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 import 'dart:convert'; 5 import 'dart:convert';
6 6
7 import 'package:pub/src/io.dart'; 7 import 'package:pub/src/io.dart';
8 import 'package:scheduled_test/scheduled_test.dart'; 8 import 'package:scheduled_test/scheduled_test.dart';
9 import 'package:scheduled_test/scheduled_server.dart'; 9 import 'package:scheduled_test/scheduled_server.dart';
10 import 'package:shelf/shelf.dart' as shelf; 10 import 'package:shelf/shelf.dart' as shelf;
11 11
12 import '../descriptor.dart' as d; 12 import '../descriptor.dart' as d;
13 import '../test_pub.dart'; 13 import '../test_pub.dart';
14 import 'utils.dart'; 14 import 'utils.dart';
15 15
16 main() { 16 main() {
17 initConfig();
18 // Regression test for issue 8849. 17 // Regression test for issue 8849.
19 integration('with a server-rejected refresh token, authenticates again and ' 18 integration('with a server-rejected refresh token, authenticates again and '
20 'saves credentials.json', () { 19 'saves credentials.json', () {
21 d.validPackage.create(); 20 d.validPackage.create();
22 21
23 var server = new ScheduledServer(); 22 var server = new ScheduledServer();
24 d.credentialsFile(server, 'access token', 23 d.credentialsFile(server, 'access token',
25 refreshToken: 'bad refresh token', 24 refreshToken: 'bad refresh token',
26 expiration: new DateTime.now().subtract(new Duration(hours: 1))) 25 expiration: new DateTime.now().subtract(new Duration(hours: 1)))
27 .create(); 26 .create();
(...skipping 16 matching lines...) Expand all
44 server.handle('GET', '/api/packages/versions/new', (request) { 43 server.handle('GET', '/api/packages/versions/new', (request) {
45 expect(request.headers, 44 expect(request.headers,
46 containsPair('authorization', 'Bearer new access token')); 45 containsPair('authorization', 'Bearer new access token'));
47 46
48 return new shelf.Response(200); 47 return new shelf.Response(200);
49 }); 48 });
50 49
51 pub.kill(); 50 pub.kill();
52 }); 51 });
53 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698