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

Unified Diff: sdk/lib/_internal/pub/test/test_pub.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: sdk/lib/_internal/pub/test/test_pub.dart
diff --git a/sdk/lib/_internal/pub/test/test_pub.dart b/sdk/lib/_internal/pub/test/test_pub.dart
index bf5139207ae4c96eeac7588dac6361246861930a..68f39aad9666e7748d064db5a2120d7993b4e208 100644
--- a/sdk/lib/_internal/pub/test/test_pub.dart
+++ b/sdk/lib/_internal/pub/test/test_pub.dart
@@ -11,7 +11,6 @@ library test_pub;
import 'dart:async';
import 'dart:convert';
import 'dart:io';
-import 'dart:json' as json;
import 'dart:math';
import 'package:http/testing.dart';
@@ -198,14 +197,14 @@ void servePackages(List<Map> pubspecs) {
_servedPackageDir.contents.clear();
for (var name in _servedPackages.keys) {
_servedApiPackageDir.contents.addAll([
- d.file('$name', json.stringify({
+ d.file('$name', JSON.encode({
'name': name,
'uploaders': ['nweiz@google.com'],
'versions': _servedPackages[name].map(packageVersionApiMap).toList()
})),
d.dir(name, [
d.dir('versions', _servedPackages[name].map((pubspec) {
- return d.file(pubspec['version'], json.stringify(
+ return d.file(pubspec['version'], JSON.encode(
packageVersionApiMap(pubspec, full: true)));
}))
])
@@ -215,7 +214,7 @@ void servePackages(List<Map> pubspecs) {
d.dir('versions', _servedPackages[name].map((pubspec) {
var version = pubspec['version'];
return d.tar('$version.tar.gz', [
- d.file('pubspec.yaml', json.stringify(pubspec)),
+ d.file('pubspec.yaml', JSON.encode(pubspec)),
d.libDir(name, '$name $version')
]);
}))
@@ -226,7 +225,7 @@ void servePackages(List<Map> pubspecs) {
}
/// Converts [value] into a YAML string.
-String yaml(value) => json.stringify(value);
+String yaml(value) => JSON.encode(value);
/// The full path to the created sandbox directory for an integration test.
String get sandboxDir => _sandboxDir;
@@ -741,7 +740,7 @@ void _validateOutputJson(List<String> failures, String pipe,
expected, String actualText) {
var actual;
try {
- actual = json.parse(actualText);
+ actual = JSON.decode(actualText);
} on FormatException catch(error) {
failures.add('Expected $pipe JSON:');
failures.add(expected);

Powered by Google App Engine
This is Rietveld 408576698