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

Unified Diff: pkg/watcher/test/no_subscription/shared.dart

Issue 59143006: Work around a flake in the Mac OS watcher test on the bots. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « pkg/pkg.status ('k') | pkg/watcher/test/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/watcher/test/no_subscription/shared.dart
diff --git a/pkg/watcher/test/no_subscription/shared.dart b/pkg/watcher/test/no_subscription/shared.dart
index cd279e1ca2c88086e141b7ec27fb0016bd2b0860..6623ba363f349b76dfc4e86acc23f771828604f0 100644
--- a/pkg/watcher/test/no_subscription/shared.dart
+++ b/pkg/watcher/test/no_subscription/shared.dart
@@ -19,8 +19,7 @@ sharedTests() {
// Subscribe to the events.
var completer = new Completer();
var subscription = watcher.events.listen(wrapAsync((event) {
- expect(event.type, equals(ChangeType.ADD));
- expect(event.path, endsWith("file.txt"));
+ expect(event, isWatchEvent(ChangeType.ADD, "file.txt"));
completer.complete();
}));
@@ -41,10 +40,19 @@ sharedTests() {
schedule(() {
completer = new Completer();
subscription = watcher.events.listen(wrapAsync((event) {
+ // TODO(nweiz): Remove this when either issue 14373 or 14793 is fixed.
+ // Issue 14373 means that the new [Directory.watch] will emit an event
+ // for "unwatched.txt" being created, and issue 14793 means we have to
+ // check the filesystem, which leads us to assume that the file has been
+ // modified.
+ if (Platform.isMacOS && event.path.endsWith("unwatched.txt")) {
+ expect(event, isWatchEvent(ChangeType.MODIFY, "unwatched.txt"));
+ return;
+ }
+
// We should get an event for the third file, not the one added while
// we weren't subscribed.
- expect(event.type, equals(ChangeType.ADD));
- expect(event.path, endsWith("added.txt"));
+ expect(event, isWatchEvent(ChangeType.ADD, "added.txt"));
completer.complete();
}));
« no previous file with comments | « pkg/pkg.status ('k') | pkg/watcher/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698