Add some debug prints to figure out why a test is failing on windows. R=nweiz@google.com Review URL: https://codereview.chromium.org//18513006 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/watcher@24983 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/pkgs/watcher/test/utils.dart b/pkgs/watcher/test/utils.dart index 5a22e60..d822e1f 100644 --- a/pkgs/watcher/test/utils.dart +++ b/pkgs/watcher/test/utils.dart
@@ -48,6 +48,9 @@ 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); @@ -55,12 +58,17 @@ // 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; @@ -139,12 +147,17 @@ 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) { var milliseconds = _mockFileModificationTimes.putIfAbsent(path, () => 0); _mockFileModificationTimes[path]++; + // TODO(rnystrom): Temporary while debugging the Windows bot. + print(" update modtime to ${_mockFileModificationTimes[path]}"); } }); } @@ -163,9 +176,14 @@ schedule(() { new File(p.join(_sandboxDir, from)).renameSync(p.join(_sandboxDir, to)); + // TODO(rnystrom): Temporary while debugging the Windows bot. + print("rename $from -> $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]}"); }); }