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

Side by Side Diff: pkg/watcher/test/directory_watcher_test.dart

Issue 22999008: Handle watching a non-existent directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/watcher/lib/src/utils.dart ('k') | pkg/watcher/test/utils.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:scheduled_test/scheduled_test.dart'; 5 import 'package:scheduled_test/scheduled_test.dart';
6 6
7 import 'utils.dart'; 7 import 'utils.dart';
8 8
9 main() { 9 main() {
10 initConfig(); 10 initConfig();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 writeFile("a.txt", contents: "after", updateModified: false); 79 writeFile("a.txt", contents: "after", updateModified: false);
80 writeFile("b.txt", contents: "after"); 80 writeFile("b.txt", contents: "after");
81 expectModifyEvent("b.txt"); 81 expectModifyEvent("b.txt");
82 }); 82 });
83 83
84 test('watches files in subdirectories', () { 84 test('watches files in subdirectories', () {
85 createWatcher(); 85 createWatcher();
86 writeFile("a/b/c/d/file.txt"); 86 writeFile("a/b/c/d/file.txt");
87 expectAddEvent("a/b/c/d/file.txt"); 87 expectAddEvent("a/b/c/d/file.txt");
88 }); 88 });
89
90 test('watches a directory created after the watcher', () {
91 // Watch a subdirectory that doesn't exist yet.
92 createWatcher(dir: "a");
93
94 // This implicity creates it.
95 writeFile("a/b/c/d/file.txt");
96 expectAddEvent("a/b/c/d/file.txt");
97 });
98
99 test('when the watched directory is deleted, removes all files', () {
100 writeFile("dir/a.txt");
101 writeFile("dir/b.txt");
102
103 createWatcher(dir: "dir");
104
105 deleteDir("dir");
106 expectRemoveEvents(["dir/a.txt", "dir/b.txt"]);
107 });
89 } 108 }
OLDNEW
« no previous file with comments | « pkg/watcher/lib/src/utils.dart ('k') | pkg/watcher/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698