| OLD | NEW |
| 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 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:scheduled_test/scheduled_test.dart'; | 7 import 'package:scheduled_test/scheduled_test.dart'; |
| 8 import 'package:watcher/watcher.dart'; | 8 import 'package:watcher/watcher.dart'; |
| 9 | 9 |
| 10 import 'utils.dart'; | 10 import 'utils.dart'; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 expect(event.type, equals(ChangeType.ADD)); | 50 expect(event.type, equals(ChangeType.ADD)); |
| 51 expect(event.path, endsWith("added.txt")); | 51 expect(event.path, endsWith("added.txt")); |
| 52 completer.complete(); | 52 completer.complete(); |
| 53 })); | 53 })); |
| 54 }); | 54 }); |
| 55 | 55 |
| 56 // The watcher will have been cancelled and then resumed in the middle of | 56 // The watcher will have been cancelled and then resumed in the middle of |
| 57 // its pause between polling loops. That means the second scan to skip | 57 // its pause between polling loops. That means the second scan to skip |
| 58 // what changed while we were unsubscribed won't happen until after that | 58 // what changed while we were unsubscribed won't happen until after that |
| 59 // delay is done. Wait long enough for that to happen. | 59 // delay is done. Wait long enough for that to happen. |
| 60 schedule(() => new Future.delayed(watcher.pollingDelay * 2)); | 60 // |
| 61 // We're doing * 4 here because that seems to give the slower bots enough |
| 62 // time for this to complete. |
| 63 schedule(() => new Future.delayed(watcher.pollingDelay * 4)); |
| 61 | 64 |
| 62 // And add a third file. | 65 // And add a third file. |
| 63 writeFile("added.txt"); | 66 writeFile("added.txt"); |
| 64 | 67 |
| 65 // Wait until we get an event for the third file. | 68 // Wait until we get an event for the third file. |
| 66 schedule(() => completer.future); | 69 schedule(() => completer.future); |
| 67 | 70 |
| 68 schedule(() { | 71 schedule(() { |
| 69 subscription.cancel(); | 72 subscription.cancel(); |
| 70 }); | 73 }); |
| 71 }); | 74 }); |
| 72 } | 75 } |
| OLD | NEW |