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

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

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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
« no previous file with comments | « pkg/http/test/safe_http_server.dart ('k') | pkg/oauth2/test/client_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:json' as JSON; 9 import 'dart:json' as JSON;
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 15 matching lines...) Expand all
26 client = new ExpectClient(); 26 client = new ExpectClient();
27 grant = new oauth2.AuthorizationCodeGrant( 27 grant = new oauth2.AuthorizationCodeGrant(
28 'identifier', 28 'identifier',
29 'secret', 29 'secret',
30 Uri.parse('https://example.com/authorization'), 30 Uri.parse('https://example.com/authorization'),
31 Uri.parse('https://example.com/token'), 31 Uri.parse('https://example.com/token'),
32 httpClient: client); 32 httpClient: client);
33 } 33 }
34 34
35 void expectFutureThrows(future, predicate) { 35 void expectFutureThrows(future, predicate) {
36 future.catchError(expectAsync1((AsyncError e) { 36 future.catchError(expectAsync1((error) {
37 expect(predicate(e.error), isTrue); 37 expect(predicate(error), isTrue);
38 })); 38 }));
39 } 39 }
40 40
41 void main() { 41 void main() {
42 group('.getAuthorizationUrl', () { 42 group('.getAuthorizationUrl', () {
43 setUp(createGrant); 43 setUp(createGrant);
44 44
45 test('builds the correct URL', () { 45 test('builds the correct URL', () {
46 expect(grant.getAuthorizationUrl(redirectUrl).toString(), 46 expect(grant.getAuthorizationUrl(redirectUrl).toString(),
47 equals('https://example.com/authorization' 47 equals('https://example.com/authorization'
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 }); 205 });
206 206
207 expect(grant.handleAuthorizationCode('auth code'), 207 expect(grant.handleAuthorizationCode('auth code'),
208 completion(predicate((client) { 208 completion(predicate((client) {
209 expect(client.credentials.accessToken, equals('access token')); 209 expect(client.credentials.accessToken, equals('access token'));
210 return true; 210 return true;
211 }))); 211 })));
212 }); 212 });
213 }); 213 });
214 } 214 }
OLDNEW
« no previous file with comments | « pkg/http/test/safe_http_server.dart ('k') | pkg/oauth2/test/client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698