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

Side by Side Diff: pkg/oauth2/lib/src/client.dart

Issue 14694002: Fix a broken oauth2 test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | « no previous file | pkg/oauth2/test/client_test.dart » ('j') | pkg/oauth2/test/client_test.dart » ('J')
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 oauth2_client; 5 library oauth2_client;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:uri'; 8 import 'dart:uri';
9 9
10 import 'package:http/http.dart' as http; 10 import 'package:http/http.dart' as http;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return response; 103 return response;
104 } 104 }
105 105
106 if (authenticate.scheme != 'bearer') return response; 106 if (authenticate.scheme != 'bearer') return response;
107 107
108 var params = authenticate.parameters; 108 var params = authenticate.parameters;
109 if (!params.containsKey('error')) return response; 109 if (!params.containsKey('error')) return response;
110 110
111 throw new AuthorizationException( 111 throw new AuthorizationException(
112 params['error'], params['error_description'], 112 params['error'], params['error_description'],
113 Uri.parse(params['error_uri'])); 113 params['error_uri'] == null ? null : Uri.parse(params['error_uri']));
114 }); 114 });
115 } 115 }
116 116
117 /// Explicitly refreshes this client's credentials. Returns this client. 117 /// Explicitly refreshes this client's credentials. Returns this client.
118 /// 118 ///
119 /// This will throw a [StateError] if the [Credentials] can't be refreshed, an 119 /// This will throw a [StateError] if the [Credentials] can't be refreshed, an
120 /// [AuthorizationException] if refreshing the credentials fails, or a 120 /// [AuthorizationException] if refreshing the credentials fails, or a
121 /// [FormatError] if the authorization server returns invalid responses. 121 /// [FormatError] if the authorization server returns invalid responses.
122 /// 122 ///
123 /// You may request different scopes than the default by passing in 123 /// You may request different scopes than the default by passing in
(...skipping 14 matching lines...) Expand all
138 return this; 138 return this;
139 }); 139 });
140 } 140 }
141 141
142 /// Closes this client and its underlying HTTP client. 142 /// Closes this client and its underlying HTTP client.
143 void close() { 143 void close() {
144 if (_httpClient != null) _httpClient.close(); 144 if (_httpClient != null) _httpClient.close();
145 _httpClient = null; 145 _httpClient = null;
146 } 146 }
147 } 147 }
OLDNEW
« no previous file with comments | « no previous file | pkg/oauth2/test/client_test.dart » ('j') | pkg/oauth2/test/client_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698