| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.src.task.driver_test; | 5 library test.src.task.driver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/context/cache.dart'; | 7 import 'package:analyzer/src/context/cache.dart'; |
| 8 import 'package:analyzer/src/generated/engine.dart' | 8 import 'package:analyzer/src/generated/engine.dart' |
| 9 show | 9 show |
| 10 AnalysisContext, | 10 AnalysisContext, |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 | 721 |
| 722 @reflectiveTest | 722 @reflectiveTest |
| 723 class SdkCachePartitionTest extends CachePartitionTest { | 723 class SdkCachePartitionTest extends CachePartitionTest { |
| 724 CachePartition createPartition() { | 724 CachePartition createPartition() { |
| 725 return new SdkCachePartition(null); | 725 return new SdkCachePartition(null); |
| 726 } | 726 } |
| 727 | 727 |
| 728 void test_contains_false() { | 728 void test_contains_false() { |
| 729 CachePartition partition = createPartition(); | 729 CachePartition partition = createPartition(); |
| 730 AnalysisTarget target = new TestSource(); | 730 AnalysisTarget target = new TestSource(); |
| 731 expect(partition.contains(target), isFalse); | 731 expect(partition.isResponsibleFor(target), isFalse); |
| 732 } | 732 } |
| 733 | 733 |
| 734 void test_contains_true() { | 734 void test_contains_true() { |
| 735 SdkCachePartition partition = new SdkCachePartition(null); | 735 SdkCachePartition partition = new SdkCachePartition(null); |
| 736 SourceFactory factory = new SourceFactory( | 736 SourceFactory factory = new SourceFactory( |
| 737 [new DartUriResolver(DirectoryBasedDartSdk.defaultSdk)]); | 737 [new DartUriResolver(DirectoryBasedDartSdk.defaultSdk)]); |
| 738 AnalysisTarget target = factory.forUri("dart:core"); | 738 AnalysisTarget target = factory.forUri("dart:core"); |
| 739 expect(partition.contains(target), isTrue); | 739 expect(partition.isResponsibleFor(target), isTrue); |
| 740 } | 740 } |
| 741 } | 741 } |
| 742 | 742 |
| 743 @reflectiveTest | 743 @reflectiveTest |
| 744 class UniversalCachePartitionTest extends CachePartitionTest { | 744 class UniversalCachePartitionTest extends CachePartitionTest { |
| 745 CachePartition createPartition() { | 745 CachePartition createPartition() { |
| 746 return new UniversalCachePartition(null); | 746 return new UniversalCachePartition(null); |
| 747 } | 747 } |
| 748 | 748 |
| 749 void test_contains() { | 749 void test_contains() { |
| 750 UniversalCachePartition partition = new UniversalCachePartition(null); | 750 UniversalCachePartition partition = new UniversalCachePartition(null); |
| 751 TestSource source = new TestSource(); | 751 TestSource source = new TestSource(); |
| 752 expect(partition.contains(source), isTrue); | 752 expect(partition.isResponsibleFor(source), isTrue); |
| 753 } | 753 } |
| 754 } | 754 } |
| 755 | 755 |
| 756 class _InternalAnalysisContextMock extends TypedMock | 756 class _InternalAnalysisContextMock extends TypedMock |
| 757 implements InternalAnalysisContext { | 757 implements InternalAnalysisContext { |
| 758 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 758 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 759 } | 759 } |
| OLD | NEW |