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

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

Issue 46843003: Wrap Directory.watch on linux for the watcher package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review 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/watcher/test/no_subscription/polling_test.dart ('k') | pkg/watcher/test/no_subscription_test.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_test.dart b/pkg/watcher/test/no_subscription/shared.dart
similarity index 73%
rename from pkg/watcher/test/no_subscription_test.dart
rename to pkg/watcher/test/no_subscription/shared.dart
index 2e7b6d3ffe44cafb9ae1ecc93630c3abf7e6ec52..cd279e1ca2c88086e141b7ec27fb0016bd2b0860 100644
--- a/pkg/watcher/test/no_subscription_test.dart
+++ b/pkg/watcher/test/no_subscription/shared.dart
@@ -7,14 +7,10 @@ import 'dart:async';
import 'package:scheduled_test/scheduled_test.dart';
import 'package:watcher/watcher.dart';
-import 'utils.dart';
+import '../utils.dart';
-main() {
- initConfig();
-
- setUp(createSandbox);
-
- test('does not notify for changes when there were no subscribers', () {
+sharedTests() {
+ test('does not notify for changes when there are no subscribers', () {
// Note that this test doesn't rely as heavily on the test functions in
// utils.dart because it needs to be very explicit about when the event
// stream is and is not subscribed.
@@ -51,16 +47,10 @@ main() {
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.
- //
- // We're doing * 4 here because that seems to give the slower bots enough
- // time for this to complete.
- schedule(() => new Future.delayed(watcher.pollingDelay * 4));
+ // Wait until the watcher is ready to dispatch events again.
+ return watcher.ready;
+ });
// And add a third file.
writeFile("added.txt");
« no previous file with comments | « pkg/watcher/test/no_subscription/polling_test.dart ('k') | pkg/watcher/test/no_subscription_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698