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

Unified Diff: lib/discovery.dart

Issue 1152173005: Add more tests (Closed) Base URL: https://github.com/dart-lang/package_config.git@master
Patch Set: Add test to all.dart Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/packages_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/discovery.dart
diff --git a/lib/discovery.dart b/lib/discovery.dart
index 78254eeba4151975f01aa3c6a8c9f58a50f16a47..52f208d81da9c0008e4caf9bea9f54ff28d92081 100644
--- a/lib/discovery.dart
+++ b/lib/discovery.dart
@@ -44,9 +44,9 @@ Future<Packages> findPackages(
if (baseUri.scheme == "file") {
return new Future<Packages>.sync(() => findPackagesFromFile(baseUri));
} else if (baseUri.scheme == "http" || baseUri.scheme == "https") {
- return findPackagesFromNonFile(baseUri, _httpGet);
+ return findPackagesFromNonFile(baseUri, loader: _httpGet);
} else if (loader != null) {
- return findPackagesFromNonFile(baseUri, loader);
+ return findPackagesFromNonFile(baseUri, loader: loader);
} else {
return new Future<Packages>.value(Packages.noPackages);
}
@@ -138,7 +138,7 @@ Packages findPackagesFromFile(Uri fileBaseUri) {
/// of the requestsed `.packages` file as bytes, which will be assumed to be
/// UTF-8 encoded.
Future<Packages> findPackagesFromNonFile(Uri nonFileUri,
- [Future<List<int>> loader(Uri name)]) {
+ {Future<List<int>> loader(Uri name)}) {
if (loader == null) loader = _httpGet;
Uri packagesFileUri = nonFileUri.resolve(".packages");
return loader(packagesFileUri).then((List<int> fileBytes) {
« no previous file with comments | « no previous file | lib/src/packages_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698