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

Unified Diff: utils/testrunner/pipeline_utils.dart

Issue 11093033: Added ability to have custom test HTTP server handlers in the test directories. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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: utils/testrunner/pipeline_utils.dart
===================================================================
--- utils/testrunner/pipeline_utils.dart (revision 13447)
+++ utils/testrunner/pipeline_utils.dart (working copy)
@@ -20,6 +20,23 @@
'${p.filenameWithoutExtension}${suffix}';
}
+/**
+ * Given a file path [file], make it absolute if it is relative,
+ * and return the result as a [Path].
+ */
+Path getAbsolutePath(String file) {
+ var p = new Path(file).canonicalize();
+ if (p.isAbsolute) {
+ return p;
+ } else {
+ var cwd = new Path((new Directory.current()).path);
+ return cwd.join(p);
+ }
+}
+
+/** Get the directory that contains a [file]. */
+String getDirectory(String file) => getAbsolutePath(file).directoryPath.toString();
Siggi Cherem (dart-lang) 2012/10/10 17:51:32 80 col
gram 2012/10/17 00:03:28 Done.
+
/** Create a file [fileName] and populate it with [contents]. */
void writeFile(String fileName, String contents) {
var file = new File(fileName);

Powered by Google App Engine
This is Rietveld 408576698