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

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

Issue 21628002: Re-implement directory polling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Split out async queue. 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 | « pkg/watcher/lib/src/directory_watcher.dart ('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_test.dart
diff --git a/pkg/watcher/test/no_subscription_test.dart b/pkg/watcher/test/no_subscription_test.dart
index e9cb4e363734bd0709928d07d9b044b01f28a8ca..8a3b03159b431ae08f5a4fd85b1b67ce591ac0ab 100644
--- a/pkg/watcher/test/no_subscription_test.dart
+++ b/pkg/watcher/test/no_subscription_test.dart
@@ -23,11 +23,11 @@ main() {
// Subscribe to the events.
var completer = new Completer();
- var subscription = watcher.events.listen((event) {
+ var subscription = watcher.events.listen(wrapAsync((event) {
expect(event.type, equals(ChangeType.ADD));
expect(event.path, endsWith("file.txt"));
completer.complete();
- });
+ }));
writeFile("file.txt");
@@ -45,20 +45,20 @@ main() {
// Then start listening again.
schedule(() {
completer = new Completer();
- subscription = watcher.events.listen((event) {
+ subscription = watcher.events.listen(wrapAsync((event) {
// 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"));
completer.complete();
- });
+ }));
});
// The watcher will have been cancelled and then resumed in the middle of
// its pause between polling loops. That means the second scan to skip
// what changed while we were unsubscribed won't happen until after that
// delay is done. Wait long enough for that to happen.
- schedule(() => new Future.delayed(new Duration(seconds: 1)));
+ schedule(() => new Future.delayed(watcher.pollingDelay * 2));
// And add a third file.
writeFile("added.txt");
« no previous file with comments | « pkg/watcher/lib/src/directory_watcher.dart ('k') | pkg/watcher/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698