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

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

Issue 11659009: Reapply "Fix URI encoding/decoding of + and space"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated tests Created 8 years 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/http_test.dart ('k') | sdk/lib/uri/encode_decode.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:io'; 7 import 'dart:io';
8 import 'dart:json'; 8 import 'dart:json';
9 import 'dart:uri'; 9 import 'dart:uri';
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 }); 43 });
44 44
45 test('builds the correct URL with scopes', () { 45 test('builds the correct URL with scopes', () {
46 var authorizationUrl = grant.getAuthorizationUrl( 46 var authorizationUrl = grant.getAuthorizationUrl(
47 redirectUrl, scopes: ['scope', 'other/scope']); 47 redirectUrl, scopes: ['scope', 'other/scope']);
48 expect(authorizationUrl.toString(), 48 expect(authorizationUrl.toString(),
49 equals('https://example.com/authorization' 49 equals('https://example.com/authorization'
50 '?response_type=code' 50 '?response_type=code'
51 '&client_id=identifier' 51 '&client_id=identifier'
52 '&redirect_uri=http%3A%2F%2Fexample.com%2Fredirect' 52 '&redirect_uri=http%3A%2F%2Fexample.com%2Fredirect'
53 '&scope=scope%20other%2Fscope')); 53 '&scope=scope+other%2Fscope'));
54 }); 54 });
55 55
56 test('builds the correct URL with state', () { 56 test('builds the correct URL with state', () {
57 var authorizationUrl = grant.getAuthorizationUrl( 57 var authorizationUrl = grant.getAuthorizationUrl(
58 redirectUrl, state: 'state'); 58 redirectUrl, state: 'state');
59 expect(authorizationUrl.toString(), 59 expect(authorizationUrl.toString(),
60 equals('https://example.com/authorization' 60 equals('https://example.com/authorization'
61 '?response_type=code' 61 '?response_type=code'
62 '&client_id=identifier' 62 '&client_id=identifier'
63 '&redirect_uri=http%3A%2F%2Fexample.com%2Fredirect' 63 '&redirect_uri=http%3A%2F%2Fexample.com%2Fredirect'
(...skipping 123 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/http/test/http_test.dart ('k') | sdk/lib/uri/encode_decode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698