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

Side by Side Diff: pkg/oauth2/test/authorization_code_grant_test.dart

Issue 11412083: Fix OAuth2 tests, and disable them on non-dart:io platforms. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 authorization_code_grant_test; 5 library authorization_code_grant_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:json'; 8 import 'dart:json';
9 import 'dart:uri'; 9 import 'dart:uri';
10 10
11 import '../../unittest/lib/unittest.dart'; 11 import '../../unittest/lib/unittest.dart';
12 import '../../http/lib/http.dart' as http; 12 import '../../http/lib/http.dart' as http;
13 import '../../http/lib/testing.dart'; 13 import '../../http/lib/testing.dart';
14 import '../lib/oauth2.dart' as oauth2; 14 import '../lib/oauth2.dart' as oauth2;
15 import 'utils.dart'; 15 import 'utils.dart';
16 16
17 final redirectUrl = new Uri.fromString('http://example.com/redirect'); 17 final redirectUrl = new Uri.fromString('http://example.com/redirect');
18 18
19 ExpectClient client; 19 ExpectClient client;
20 20
21 AuthorizationCodeGrant grant; 21 oauth2.AuthorizationCodeGrant grant;
22 22
23 void createGrant() { 23 void createGrant() {
24 client = new ExpectClient(); 24 client = new ExpectClient();
25 grant = new oauth2.AuthorizationCodeGrant( 25 grant = new oauth2.AuthorizationCodeGrant(
26 'identifier', 26 'identifier',
27 'secret', 27 'secret',
28 new Uri.fromString('https://example.com/authorization'), 28 new Uri.fromString('https://example.com/authorization'),
29 new Uri.fromString('https://example.com/token'), 29 new Uri.fromString('https://example.com/token'),
30 httpClient: client); 30 httpClient: client);
31 } 31 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 }); 187 });
188 188
189 expect(grant.handleAuthorizationCode('auth code'), 189 expect(grant.handleAuthorizationCode('auth code'),
190 completion(predicate((client) { 190 completion(predicate((client) {
191 expect(client.credentials.accessToken, equals('access token')); 191 expect(client.credentials.accessToken, equals('access token'));
192 return true; 192 return true;
193 }))); 193 })));
194 }); 194 });
195 }); 195 });
196 } 196 }
OLDNEW
« no previous file with comments | « pkg/oauth2/lib/src/expiration_exception.dart ('k') | pkg/oauth2/test/handle_access_token_response_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698