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

Unified Diff: pkg/watcher/test/utils.dart

Issue 18430006: Normalize paths in mock timestamp map. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/watcher/test/utils.dart
diff --git a/pkg/watcher/test/utils.dart b/pkg/watcher/test/utils.dart
index d822e1fc237bdd666e8bf111299156b7b80a3f3f..747171657e7b89c7d3285baf0a9bd45298affdba 100644
--- a/pkg/watcher/test/utils.dart
+++ b/pkg/watcher/test/utils.dart
@@ -48,27 +48,19 @@ void createSandbox() {
var dir = new Directory("").createTempSync();
_sandboxDir = dir.path;
- // TODO(rnystrom): Temporary while debugging the Windows bot.
- print("create mock modtime map for $_sandboxDir");
-
_mockFileModificationTimes = new Map<String, int>();
mockGetModificationTime((path) {
- path = p.relative(path, from: _sandboxDir);
+ path = p.normalize(p.relative(path, from: _sandboxDir));
// Make sure we got a path in the sandbox.
assert(p.isRelative(path) && !path.startsWith(".."));
- // TODO(rnystrom): Temporary while debugging the Windows bot.
- print("get mock modtime for $path = ${_mockFileModificationTimes[path]}");
return new DateTime.fromMillisecondsSinceEpoch(
_mockFileModificationTimes[path]);
});
// Delete the sandbox when done.
currentSchedule.onComplete.schedule(() {
- // TODO(rnystrom): Temporary while debugging the Windows bot.
- print("delete mock modtime map for $_sandboxDir");
-
if (_sandboxDir != null) {
new Directory(_sandboxDir).deleteSync(recursive: true);
_sandboxDir = null;
@@ -147,17 +139,15 @@ void writeFile(String path, {String contents, bool updateModified}) {
dir.createSync(recursive: true);
}
- // TODO(rnystrom): Temporary while debugging the Windows bot.
- print("write $path");
-
new File(fullPath).writeAsStringSync(contents);
// Manually update the mock modification time for the file.
if (updateModified) {
+ // Make sure we always use the same separator on Windows.
+ path = p.normalize(path);
+
var milliseconds = _mockFileModificationTimes.putIfAbsent(path, () => 0);
_mockFileModificationTimes[path]++;
- // TODO(rnystrom): Temporary while debugging the Windows bot.
- print(" update modtime to ${_mockFileModificationTimes[path]}");
}
});
}
@@ -176,14 +166,12 @@ void renameFile(String from, String to) {
schedule(() {
new File(p.join(_sandboxDir, from)).renameSync(p.join(_sandboxDir, to));
- // TODO(rnystrom): Temporary while debugging the Windows bot.
- print("rename $from -> $to");
+ // Make sure we always use the same separator on Windows.
+ to = p.normalize(to);
// Manually update the mock modification time for the file.
var milliseconds = _mockFileModificationTimes.putIfAbsent(to, () => 0);
_mockFileModificationTimes[to]++;
- // TODO(rnystrom): Temporary while debugging the Windows bot.
- print(" update modtime to ${_mockFileModificationTimes[to]}");
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698