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 import 'package:analyzer/src/generated/java_engine.dart'; | 9 import 'package:analyzer/src/generated/java_engine.dart'; |
10 import 'package:analyzer/src/generated/sdk_io.dart'; | 10 import 'package:analyzer/src/generated/sdk_io.dart'; |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 // dispose | 1107 // dispose |
1108 partition2.dispose(); | 1108 partition2.dispose(); |
1109 expect(partition1.get(target1), same(entry1)); | 1109 expect(partition1.get(target1), same(entry1)); |
1110 expect(partition2.get(target2), isNull); | 1110 expect(partition2.get(target2), isNull); |
1111 // result2 is removed from result1 | 1111 // result2 is removed from result1 |
1112 expect(entry1.getResultData(descriptor1).dependentResults, isEmpty); | 1112 expect(entry1.getResultData(descriptor1).dependentResults, isEmpty); |
1113 } | 1113 } |
1114 } | 1114 } |
1115 | 1115 |
1116 class _InternalAnalysisContextMock extends TypedMock | 1116 class _InternalAnalysisContextMock extends TypedMock |
1117 implements InternalAnalysisContext { | 1117 implements InternalAnalysisContext {} |
1118 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | |
1119 } | |
1120 | 1118 |
1121 /** | 1119 /** |
1122 * Keep the given [keepDescriptor], invalidate all the other results. | 1120 * Keep the given [keepDescriptor], invalidate all the other results. |
1123 */ | 1121 */ |
1124 class _KeepContinueDelta implements Delta { | 1122 class _KeepContinueDelta implements Delta { |
1125 final Source source; | 1123 final Source source; |
1126 final ResultDescriptor keepDescriptor; | 1124 final ResultDescriptor keepDescriptor; |
1127 | 1125 |
1128 _KeepContinueDelta(this.source, this.keepDescriptor); | 1126 _KeepContinueDelta(this.source, this.keepDescriptor); |
1129 | 1127 |
1130 @override | 1128 @override |
1131 DeltaResult validate(InternalAnalysisContext context, AnalysisTarget target, | 1129 DeltaResult validate(InternalAnalysisContext context, AnalysisTarget target, |
1132 ResultDescriptor descriptor) { | 1130 ResultDescriptor descriptor) { |
1133 if (descriptor == keepDescriptor) { | 1131 if (descriptor == keepDescriptor) { |
1134 return DeltaResult.KEEP_CONTINUE; | 1132 return DeltaResult.KEEP_CONTINUE; |
1135 } | 1133 } |
1136 return DeltaResult.INVALIDATE; | 1134 return DeltaResult.INVALIDATE; |
1137 } | 1135 } |
1138 } | 1136 } |
1139 | 1137 |
1140 class _TestAnalysisTarget implements AnalysisTarget { | 1138 class _TestAnalysisTarget implements AnalysisTarget { |
1141 @override | 1139 @override |
1142 Source get source => null; | 1140 Source get source => null; |
1143 } | 1141 } |
OLD | NEW |