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 analyzer.test.file_system.physical_resource_provider_test; | 5 library analyzer.test.file_system.physical_resource_provider_test; |
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } | 370 } |
371 expect(grandParent, new isInstanceOf<Folder>()); | 371 expect(grandParent, new isInstanceOf<Folder>()); |
372 expect(grandParent.path.length, lessThan(parent.path.length)); | 372 expect(grandParent.path.length, lessThan(parent.path.length)); |
373 parent = grandParent; | 373 parent = grandParent; |
374 } | 374 } |
375 } | 375 } |
376 } | 376 } |
377 | 377 |
378 @reflectiveTest | 378 @reflectiveTest |
379 class PhysicalResourceProviderTest extends _BaseTest { | 379 class PhysicalResourceProviderTest extends _BaseTest { |
| 380 test_getModificationTimes() async { |
| 381 PhysicalResourceProvider provider = PhysicalResourceProvider.INSTANCE; |
| 382 String path = join(tempPath, 'file1.txt'); |
| 383 new io.File(path).writeAsStringSync(''); |
| 384 Source source = provider.getFile(path).createSource(); |
| 385 List<int> times = await provider.getModificationTimes([source]); |
| 386 expect(times, [source.modificationStamp]); |
| 387 } |
| 388 |
380 void test_getStateLocation_uniqueness() { | 389 void test_getStateLocation_uniqueness() { |
381 PhysicalResourceProvider provider = PhysicalResourceProvider.INSTANCE; | 390 PhysicalResourceProvider provider = PhysicalResourceProvider.INSTANCE; |
382 String idOne = 'one'; | 391 String idOne = 'one'; |
383 Folder folderOne = provider.getStateLocation(idOne); | 392 Folder folderOne = provider.getStateLocation(idOne); |
384 expect(folderOne, isNotNull); | 393 expect(folderOne, isNotNull); |
385 String idTwo = 'two'; | 394 String idTwo = 'two'; |
386 Folder folderTwo = provider.getStateLocation(idTwo); | 395 Folder folderTwo = provider.getStateLocation(idTwo); |
387 expect(folderTwo, isNotNull); | 396 expect(folderTwo, isNotNull); |
388 expect(folderTwo, isNot(equals(folderOne))); | 397 expect(folderTwo, isNot(equals(folderOne))); |
389 expect(provider.getStateLocation(idOne), equals(folderOne)); | 398 expect(provider.getStateLocation(idOne), equals(folderOne)); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 553 |
545 setUp() { | 554 setUp() { |
546 tempDirectory = io.Directory.systemTemp.createTempSync('test_resource'); | 555 tempDirectory = io.Directory.systemTemp.createTempSync('test_resource'); |
547 tempPath = tempDirectory.absolute.path; | 556 tempPath = tempDirectory.absolute.path; |
548 } | 557 } |
549 | 558 |
550 tearDown() { | 559 tearDown() { |
551 tempDirectory.deleteSync(recursive: true); | 560 tempDirectory.deleteSync(recursive: true); |
552 } | 561 } |
553 } | 562 } |
OLD | NEW |