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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 12255016: Get rid of old redundant methods in io.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
« utils/pub/io.dart ('K') | « utils/pub/validator/name.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index b84a7aa658dacf9f9ff1d0abefdcbdea2e738fb7..87c713edc44a3c0b9d24d75d58805428a86ef89d 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -423,7 +423,9 @@ String _packageName(String sourceName, description) {
switch (sourceName) {
case "git":
var url = description is String ? description : description['url'];
- return basename(url.replaceFirst(new RegExp(r"(\.git)?/?$"), ""));
+ // TODO(rnystrom): Using path.basename on a URL is hacky. If we add URL
+ // support to pkg/path, should use an explicit builder for that.
+ return path.basename(url.replaceFirst(new RegExp(r"(\.git)?/?$"), ""));
case "hosted":
if (description is String) return description;
return description['name'];
@@ -452,7 +454,7 @@ final String packagesPath = "$appPath/packages";
/// The type for callbacks that will be fired during [schedulePub]. Takes the
/// sandbox directory as a parameter.
-typedef Future _ScheduledEvent(Directory parentDir);
+typedef Future _ScheduledEvent(String parentDir);
/// The list of events that are scheduled to run as part of the test case.
List<_ScheduledEvent> _scheduled;
@@ -527,9 +529,9 @@ void _integration(String description, void body(), [Function testFn]) {
/// tests.
String get testDirectory {
var dir = new Options().script;
- while (basename(dir) != 'pub') dir = dirname(dir);
+ while (path.basename(dir) != 'pub') dir = path.dirname(dir);
- return getFullPath(dir);
+ return path.absolute(dir);
}
/// Schedules a call to the Pub command-line utility. Runs Pub with [args] and
@@ -607,7 +609,10 @@ void confirmPublish(ScheduledProcess pub) {
/// should have the same signature as [startProcess], except that the returned
/// [Future] may have a type other than [Process].
Future _doPub(Function fn, sandboxDir, List args, Future<Uri> tokenEndpoint) {
- String pathInSandbox(path) => join(getFullPath(sandboxDir), path);
+ String pathInSandbox(String relPath) {
+ return join(path.absolute(sandboxDir), relPath);
+ }
+
return defer(() {
ensureDir(pathInSandbox(appPath));
return Future.wait([
@@ -677,7 +682,7 @@ void useMockClient(MockClient client) {
});
}
-Future _runScheduled(Directory parentDir, List<_ScheduledEvent> scheduled) {
+Future _runScheduled(String parentDir, List<_ScheduledEvent> scheduled) {
if (scheduled == null) return new Future.immediate(null);
var iterator = scheduled.iterator;
@@ -815,7 +820,7 @@ abstract class Descriptor {
/// Schedules the directory to be validated after Pub is run with
/// [schedulePub]. The directory will be validated relative to the sandbox
/// directory.
- void scheduleValidate() => _schedule((parentDir) => validate(parentDir.path));
+ void scheduleValidate() => _schedule((parentDir) => validate(parentDir));
/// Asserts that the name of the descriptor is a [String] and returns it.
String get _stringName {
« utils/pub/io.dart ('K') | « utils/pub/validator/name.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698