| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library test.physical_file_system; | 5 library test.physical_file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:core' hide Resource; | 8 import 'dart:core' hide Resource; |
| 9 import 'dart:io' as io; | 9 import 'dart:io' as io; |
| 10 | 10 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 test_watchFile_delete() { | 290 test_watchFile_delete() { |
| 291 var path = join(tempPath, 'foo'); | 291 var path = join(tempPath, 'foo'); |
| 292 var file = new io.File(path); | 292 var file = new io.File(path); |
| 293 file.writeAsStringSync('contents 1'); | 293 file.writeAsStringSync('contents 1'); |
| 294 return _watchingFile(path, (changesReceived) { | 294 return _watchingFile(path, (changesReceived) { |
| 295 expect(changesReceived, hasLength(0)); | 295 expect(changesReceived, hasLength(0)); |
| 296 file.deleteSync(); | 296 file.deleteSync(); |
| 297 return _delayed(() { | 297 return _delayed(() { |
| 298 expect(changesReceived, hasLength(1)); | 298 expect(changesReceived, hasLength(1)); |
| 299 expect(changesReceived[0].type, equals(ChangeType.REMOVE)); | 299 if (io.Platform.isWindows) { |
| 300 // TODO(danrubel) https://github.com/dart-lang/sdk/issues/23762 |
| 301 // This test fails on Windows but a similar test in the underlying |
| 302 // watcher package passes on Windows. |
| 303 expect(changesReceived[0].type, equals(ChangeType.MODIFY)); |
| 304 } else { |
| 305 expect(changesReceived[0].type, equals(ChangeType.REMOVE)); |
| 306 } |
| 300 expect(changesReceived[0].path, equals(path)); | 307 expect(changesReceived[0].path, equals(path)); |
| 301 }); | 308 }); |
| 302 }); | 309 }); |
| 303 } | 310 } |
| 304 | 311 |
| 305 test_watchFile_modify() { | 312 test_watchFile_modify() { |
| 306 var path = join(tempPath, 'foo'); | 313 var path = join(tempPath, 'foo'); |
| 307 var file = new io.File(path); | 314 var file = new io.File(path); |
| 308 file.writeAsStringSync('contents 1'); | 315 file.writeAsStringSync('contents 1'); |
| 309 return _watchingFile(path, (changesReceived) { | 316 return _watchingFile(path, (changesReceived) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 440 |
| 434 setUp() { | 441 setUp() { |
| 435 tempDirectory = io.Directory.systemTemp.createTempSync('test_resource'); | 442 tempDirectory = io.Directory.systemTemp.createTempSync('test_resource'); |
| 436 tempPath = tempDirectory.absolute.path; | 443 tempPath = tempDirectory.absolute.path; |
| 437 } | 444 } |
| 438 | 445 |
| 439 tearDown() { | 446 tearDown() { |
| 440 tempDirectory.deleteSync(recursive: true); | 447 tempDirectory.deleteSync(recursive: true); |
| 441 } | 448 } |
| 442 } | 449 } |
| OLD | NEW |