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

Unified Diff: tests/html/xhr_cross_origin_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: tests/html/xhr_cross_origin_test.dart
diff --git a/tests/html/xhr_cross_origin_test.dart b/tests/html/xhr_cross_origin_test.dart
index a9eda406fb9e35f3cdfd1a010308d8a1a420d587..5a0f6cb61b8a5d05838b88666356466f5c0f8f15 100644
--- a/tests/html/xhr_cross_origin_test.dart
+++ b/tests/html/xhr_cross_origin_test.dart
@@ -6,7 +6,7 @@ library XHRCrossOriginTest;
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_individual_config.dart';
import 'dart:html';
-import 'dart:json' as json;
+import "dart:convert";
/**
* Examine the value of "crossOriginPort" as passed in from the url from
@@ -42,7 +42,7 @@ main() {
var gotError = false;
var url = '$host/root_dart/tests/html/xhr_cross_origin_data.txt';
return HttpRequest.request(url).then((xhr) {
- var data = json.parse(xhr.response);
+ var data = JSON.decode(xhr.response);
expect(data, contains('feed'));
expect(data['feed'], contains('entry'));
expect(data, isMap);
@@ -92,7 +92,7 @@ main() {
xhr.onReadyStateChange.listen((e) {
guardAsync(() {
if (xhr.readyState == HttpRequest.DONE) {
- validate(json.parse(xhr.response));
+ validate(JSON.decode(xhr.response));
}
});
});
@@ -102,7 +102,7 @@ main() {
test('XHR.getWithCredentials Cross-domain', () {
var url = '$host/root_dart/tests/html/xhr_cross_origin_data.txt';
return HttpRequest.request(url, withCredentials: true).then((xhr) {
- var data = json.parse(xhr.response);
+ var data = JSON.decode(xhr.response);
expect(data, contains('feed'));
expect(data['feed'], contains('entry'));
expect(data, isMap);

Powered by Google App Engine
This is Rietveld 408576698