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

Unified Diff: runtime/bin/directory_impl.dart

Issue 8799009: Add support for client/dartc compilation only tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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: runtime/bin/directory_impl.dart
diff --git a/runtime/bin/directory_impl.dart b/runtime/bin/directory_impl.dart
index ee4cbaa9c04282743e4d22ff3b1f4e0803a1a256..e87cb540c64eb1911cdba87fc4bc575bf3531f5f 100644
--- a/runtime/bin/directory_impl.dart
+++ b/runtime/bin/directory_impl.dart
@@ -36,12 +36,10 @@ class _DirectoryCreateTempIsolate extends Isolate {
void main() {
port.receive((path, replyTo) {
// Call function to get file name
- replyTo.send(_createTemp(path, (Math.random() * 0x8000000).toInt()));
+ replyTo.send(_Directory._createTemp(path, (Math.random() * 0x8000000).toInt()));
port.close();
});
}
-
- String _createTemp(String template, int num) native "Directory_CreateTemp";
}
@@ -49,6 +47,8 @@ class _Directory implements Directory {
_Directory(String this._path);
+ static String _createTemp(String template, int num) native "Directory_CreateTemp";
+
bool existsSync() {
int exists = _exists(_path);
if (exists < 0) {
@@ -80,6 +80,15 @@ class _Directory implements Directory {
});
}
+ void createTempSync() {
+ var result = _createTemp(path, (Math.random() * 0x8000000).toInt());
+ if (result != '') {
+ _path = result;
+ } else {
+ throw "createTempSync failed";
+ }
+ }
+
void deleteSync() {
if (!_delete(_path)) {
throw new DirectoryException("Directory deletion failed: $_path");

Powered by Google App Engine
This is Rietveld 408576698