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

Unified Diff: pkg/oauth2/test/credentials_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/credentials_test.dart
diff --git a/pkg/oauth2/test/credentials_test.dart b/pkg/oauth2/test/credentials_test.dart
index 6a873f27c86b430885d0766f7f2812cdfadbf6d1..f3e303b9af66ab0f657b585ff56d2119411c9c53 100644
--- a/pkg/oauth2/test/credentials_test.dart
+++ b/pkg/oauth2/test/credentials_test.dart
@@ -5,7 +5,7 @@
library credentials_test;
import 'dart:async';
-import 'dart:json' as JSON;
+import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:oauth2/oauth2.dart' as oauth2;
@@ -74,7 +74,7 @@ void main() {
"client_secret": "secret"
}));
- return new Future.value(new http.Response(JSON.stringify({
+ return new Future.value(new http.Response(JSON.encode({
'access_token': 'new access token',
'token_type': 'bearer',
'refresh_token': 'new refresh token'
@@ -104,7 +104,7 @@ void main() {
"client_secret": "secret"
}));
- return new Future.value(new http.Response(JSON.stringify({
+ return new Future.value(new http.Response(JSON.encode({
'access_token': 'new access token',
'token_type': 'bearer'
}), 200, headers: {'content-type': 'application/json'}));
@@ -120,7 +120,7 @@ void main() {
group("fromJson", () {
oauth2.Credentials fromMap(Map map) =>
- new oauth2.Credentials.fromJson(JSON.stringify(map));
+ new oauth2.Credentials.fromJson(JSON.encode(map));
test("should load the same credentials from toJson", () {
var expiration = new DateTime.now().subtract(new Duration(hours: 1));

Powered by Google App Engine
This is Rietveld 408576698