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

Side by Side Diff: utils/tests/pub/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:io';
6
7 import 'package:scheduled_test/scheduled_test.dart';
8 import 'package:scheduled_test/scheduled_server.dart';
9
10 import '../../../pub/io.dart';
11 import '../../../pub/utils.dart';
12 import '../descriptor.dart' as d;
13 import '../test_pub.dart';
14 import 'utils.dart';
15
16 main() {
17 initConfig();
18 integration('with no credentials.json, authenticates and saves '
19 'credentials.json', () {
20 d.validPackage.create();
21
22 var server = new ScheduledServer();
23 var pub = startPublish(server);
24 confirmPublish(pub);
25 authorizePub(pub, server);
26
27 server.handle('GET', '/packages/versions/new.json', (request) {
28 expect(request.headers.value('authorization'),
29 equals('Bearer access token'));
30
31 request.response.close();
32 });
33
34 // After we give pub an invalid response, it should crash. We wait for it to
35 // do so rather than killing it so it'll write out the credentials file.
36 pub.shouldExit(1);
37
38 d.credentialsFile(server, 'access token').validate();
39 });
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698