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 analyzer.test.src.context.cache_test; | 5 library analyzer.test.src.context.cache_test; |
6 | 6 |
7 import 'package:analyzer/exception/exception.dart'; | 7 import 'package:analyzer/exception/exception.dart'; |
8 import 'package:analyzer/file_system/file_system.dart'; | 8 import 'package:analyzer/file_system/file_system.dart'; |
9 import 'package:analyzer/file_system/memory_file_system.dart'; | 9 import 'package:analyzer/file_system/memory_file_system.dart'; |
10 import 'package:analyzer/file_system/physical_file_system.dart'; | 10 import 'package:analyzer/file_system/physical_file_system.dart'; |
11 import 'package:analyzer/source/package_map_resolver.dart'; | 11 import 'package:analyzer/source/package_map_resolver.dart'; |
12 import 'package:analyzer/src/context/cache.dart'; | 12 import 'package:analyzer/src/context/cache.dart'; |
13 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 13 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
14 import 'package:analyzer/src/generated/engine.dart'; | 14 import 'package:analyzer/src/generated/engine.dart'; |
15 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
16 import 'package:analyzer/src/generated/utilities_collection.dart'; | 16 import 'package:analyzer/src/generated/utilities_collection.dart'; |
17 import 'package:analyzer/src/task/model.dart'; | 17 import 'package:analyzer/src/task/model.dart'; |
18 import 'package:analyzer/task/model.dart'; | 18 import 'package:analyzer/task/model.dart'; |
19 import 'package:test/test.dart'; | 19 import 'package:test/test.dart'; |
20 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 20 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
21 import 'package:typed_mock/typed_mock.dart'; | 21 import 'package:mockito/mockito.dart'; |
22 | 22 |
23 import '../../generated/test_support.dart'; | 23 import '../../generated/test_support.dart'; |
24 | 24 |
25 main() { | 25 main() { |
26 defineReflectiveSuite(() { | 26 defineReflectiveSuite(() { |
27 defineReflectiveTests(AnalysisCacheTest); | 27 defineReflectiveTests(AnalysisCacheTest); |
28 defineReflectiveTests(CacheEntryTest); | 28 defineReflectiveTests(CacheEntryTest); |
29 defineReflectiveTests(CacheFlushManagerTest); | 29 defineReflectiveTests(CacheFlushManagerTest); |
30 defineReflectiveTests(SdkCachePartitionTest); | 30 defineReflectiveTests(SdkCachePartitionTest); |
31 defineReflectiveTests(UniversalCachePartitionTest); | 31 defineReflectiveTests(UniversalCachePartitionTest); |
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 entry1.getResultData(descriptor1).dependentResults, contains(result2)); | 1279 entry1.getResultData(descriptor1).dependentResults, contains(result2)); |
1280 // dispose | 1280 // dispose |
1281 partition2.dispose(); | 1281 partition2.dispose(); |
1282 expect(partition1.get(target1), same(entry1)); | 1282 expect(partition1.get(target1), same(entry1)); |
1283 expect(partition2.get(target2), isNull); | 1283 expect(partition2.get(target2), isNull); |
1284 // result2 is removed from result1 | 1284 // result2 is removed from result1 |
1285 expect(entry1.getResultData(descriptor1).dependentResults, isEmpty); | 1285 expect(entry1.getResultData(descriptor1).dependentResults, isEmpty); |
1286 } | 1286 } |
1287 } | 1287 } |
1288 | 1288 |
1289 class _InternalAnalysisContextMock extends TypedMock | 1289 class _InternalAnalysisContextMock extends Mock |
1290 implements InternalAnalysisContext { | 1290 implements InternalAnalysisContext { |
1291 @override | 1291 @override |
1292 final AnalysisOptions analysisOptions = new AnalysisOptionsImpl(); | 1292 final AnalysisOptions analysisOptions = new AnalysisOptionsImpl(); |
1293 } | 1293 } |
1294 | 1294 |
1295 /** | 1295 /** |
1296 * Keep the given [keepDescriptor], invalidate all the other results. | 1296 * Keep the given [keepDescriptor], invalidate all the other results. |
1297 */ | 1297 */ |
1298 class _KeepContinueDelta implements Delta { | 1298 class _KeepContinueDelta implements Delta { |
1299 final Source source; | 1299 final Source source; |
(...skipping 21 matching lines...) Expand all Loading... |
1321 } | 1321 } |
1322 return DeltaResult.INVALIDATE; | 1322 return DeltaResult.INVALIDATE; |
1323 } | 1323 } |
1324 } | 1324 } |
1325 | 1325 |
1326 class _TestAnalysisTarget implements AnalysisTarget { | 1326 class _TestAnalysisTarget implements AnalysisTarget { |
1327 final Source librarySource; | 1327 final Source librarySource; |
1328 final Source source; | 1328 final Source source; |
1329 _TestAnalysisTarget({this.librarySource, this.source}); | 1329 _TestAnalysisTarget({this.librarySource, this.source}); |
1330 } | 1330 } |
OLD | NEW |