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

Unified Diff: pkg/watcher/test/ready_test.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/ready/shared.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/ready_test.dart
diff --git a/pkg/watcher/test/ready_test.dart b/pkg/watcher/test/ready_test.dart
deleted file mode 100644
index 11b77e02c7ef061ea7dc8126273d39d7c04923d3..0000000000000000000000000000000000000000
--- a/pkg/watcher/test/ready_test.dart
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async';
-
-import 'package:scheduled_test/scheduled_test.dart';
-
-import 'utils.dart';
-
-main() {
- initConfig();
-
- setUp(createSandbox);
-
- test('ready does not complete until after subscription', () {
- var watcher = createWatcher(waitForReady: false);
-
- var ready = false;
- watcher.ready.then((_) {
- ready = true;
- });
-
- // Should not be ready yet.
- schedule(() {
- expect(ready, isFalse);
- });
-
- // Subscribe to the events.
- schedule(() {
- var subscription = watcher.events.listen((event) {});
-
- currentSchedule.onComplete.schedule(() {
- subscription.cancel();
- });
- });
-
- // Should eventually be ready.
- schedule(() => watcher.ready);
-
- schedule(() {
- expect(ready, isTrue);
- });
- });
-
- test('ready completes immediately when already ready', () {
- var watcher = createWatcher(waitForReady: false);
-
- // Subscribe to the events.
- schedule(() {
- var subscription = watcher.events.listen((event) {});
-
- currentSchedule.onComplete.schedule(() {
- subscription.cancel();
- });
- });
-
- // Should eventually be ready.
- schedule(() => watcher.ready);
-
- // Now ready should be a future that immediately completes.
- var ready = false;
- schedule(() {
- watcher.ready.then((_) {
- ready = true;
- });
- });
-
- schedule(() {
- expect(ready, isTrue);
- });
- });
-
- test('ready returns a future that does not complete after unsubscribing', () {
- var watcher = createWatcher(waitForReady: false);
-
- // Subscribe to the events.
- var subscription;
- schedule(() {
- subscription = watcher.events.listen((event) {});
- });
-
- var ready = false;
-
- // Wait until ready.
- schedule(() => watcher.ready);
-
- // Now unsubscribe.
- schedule(() {
- subscription.cancel();
-
- // Track when it's ready again.
- ready = false;
- watcher.ready.then((_) {
- ready = true;
- });
- });
-
- // Should be back to not ready.
- schedule(() {
- expect(ready, isFalse);
- });
- });
-}
« no previous file with comments | « pkg/watcher/test/ready/shared.dart ('k') | pkg/watcher/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698