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

Unified Diff: test/test_pub.dart

Issue 1307853004: Improve the heuristics for "pub get" is needed. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 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
« no previous file with comments | « test/must_pub_get_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/test_pub.dart
diff --git a/test/test_pub.dart b/test/test_pub.dart
index 2c7af92411fa42e0a4b25171fb556c686c662b28..5427625d392a0e93cd87f3733f85bc27b840680b 100644
--- a/test/test_pub.dart
+++ b/test/test_pub.dart
@@ -714,16 +714,35 @@ void makeGlobalPackage(String package, String version,
/// hosted packages.
void createLockFile(String package, {Iterable<String> sandbox,
Iterable<String> pkg, Map<String, String> hosted}) {
- var cache = new SystemCache.withSources(
- rootDir: p.join(sandboxDir, cachePath));
+ schedule(() async {
+ var cache = new SystemCache.withSources(
+ rootDir: p.join(sandboxDir, cachePath));
- var lockFile = _createLockFile(cache.sources,
- sandbox: sandbox, pkg: pkg, hosted: hosted);
+ var lockFile = _createLockFile(cache.sources,
+ sandbox: sandbox, pkg: pkg, hosted: hosted);
- d.dir(package, [
- d.file('pubspec.lock', lockFile.serialize(null)),
- d.file('.packages', lockFile.packagesFile(package))
- ]).create();
+ await d.dir(package, [
+ d.file('pubspec.lock', lockFile.serialize(null)),
+ d.file('.packages', lockFile.packagesFile(package))
+ ]).create();
+ }, "creating lockfile for $package");
+}
+
+/// Like [createLockFile], but creates only a `.packages` file without a
+/// lockfile.
+void createPackagesFile(String package, {Iterable<String> sandbox,
+ Iterable<String> pkg, Map<String, String> hosted}) {
+ schedule(() async {
+ var cache = new SystemCache.withSources(
+ rootDir: p.join(sandboxDir, cachePath));
+
+ var lockFile = _createLockFile(cache.sources,
+ sandbox: sandbox, pkg: pkg, hosted: hosted);
+
+ await d.dir(package, [
+ d.file('.packages', lockFile.packagesFile(package))
+ ]).create();
+ }, "creating .packages for $package");
}
/// Creates a lock file for [package] without running `pub get`.
« no previous file with comments | « test/must_pub_get_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698