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

Unified Diff: pkg/oauth2/test/handle_access_token_response_test.dart

Issue 23596007: Remove usage of dart:json. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: pkg/oauth2/test/handle_access_token_response_test.dart
diff --git a/pkg/oauth2/test/handle_access_token_response_test.dart b/pkg/oauth2/test/handle_access_token_response_test.dart
index 10e6f75e28f631fb5c7ca3bb2121467fe8303585..a99d8eaa77bf70e095614e5bb81f9828710c0ce3 100644
--- a/pkg/oauth2/test/handle_access_token_response_test.dart
+++ b/pkg/oauth2/test/handle_access_token_response_test.dart
@@ -4,7 +4,7 @@
library handle_access_token_response_test;
-import 'dart:json' as JSON;
+import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:oauth2/oauth2.dart' as oauth2;
@@ -70,28 +70,28 @@ void main() {
});
test('with a non-string error_description causes a FormatException', () {
- expect(() => handleError(body: JSON.stringify({
+ expect(() => handleError(body: JSON.encode({
"error": "invalid_request",
"error_description": 12
})), throwsFormatException);
});
test('with a non-string error_uri causes a FormatException', () {
- expect(() => handleError(body: JSON.stringify({
+ expect(() => handleError(body: JSON.encode({
"error": "invalid_request",
"error_uri": 12
})), throwsFormatException);
});
test('with a string error_description causes a AuthorizationException', () {
- expect(() => handleError(body: JSON.stringify({
+ expect(() => handleError(body: JSON.encode({
"error": "invalid_request",
"error_description": "description"
})), throwsAuthorizationException);
});
test('with a string error_uri causes a AuthorizationException', () {
- expect(() => handleError(body: JSON.stringify({
+ expect(() => handleError(body: JSON.encode({
"error": "invalid_request",
"error_uri": "http://example.com/error"
})), throwsAuthorizationException);
@@ -106,7 +106,7 @@ void main() {
expiresIn,
refreshToken,
scope}) {
- return handle(new http.Response(JSON.stringify({
+ return handle(new http.Response(JSON.encode({
'access_token': accessToken,
'token_type': tokenType,
'expires_in': expiresIn,

Powered by Google App Engine
This is Rietveld 408576698