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

Side by Side Diff: pkg/analyzer/test/src/context/cache_test.dart

Issue 1130263002: Some clean ups for cache partitions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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
OLDNEW
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
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 }
OLDNEW
« pkg/analyzer/lib/src/context/cache.dart ('K') | « pkg/analyzer/lib/src/context/cache.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698