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.task.options_work_manager_test; | 5 library analyzer.test.src.task.options_work_manager_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 AnalysisEngine, | 10 AnalysisEngine, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 cache = context.analysisCache; | 71 cache = context.analysisCache; |
72 manager = new OptionsWorkManager(context); | 72 manager = new OptionsWorkManager(context); |
73 source1 = new TestSource('test1/$optionsFile'); | 73 source1 = new TestSource('test1/$optionsFile'); |
74 source2 = new TestSource('test2/$optionsFile'); | 74 source2 = new TestSource('test2/$optionsFile'); |
75 source3 = new TestSource('test3/$optionsFile'); | 75 source3 = new TestSource('test3/$optionsFile'); |
76 source4 = new TestSource('test4/$optionsFile'); | 76 source4 = new TestSource('test4/$optionsFile'); |
77 entry1 = context.getCacheEntry(source1); | 77 entry1 = context.getCacheEntry(source1); |
78 entry2 = context.getCacheEntry(source2); | 78 entry2 = context.getCacheEntry(source2); |
79 entry3 = context.getCacheEntry(source3); | 79 entry3 = context.getCacheEntry(source3); |
80 entry4 = context.getCacheEntry(source4); | 80 entry4 = context.getCacheEntry(source4); |
| 81 when(context.canonicalizeTarget(anyObject)).thenInvoke((target) => target); |
81 } | 82 } |
82 | 83 |
83 void test_applyChange_add() { | 84 void test_applyChange_add() { |
84 // add source1 | 85 // add source1 |
85 manager.applyChange([source1], [], []); | 86 manager.applyChange([source1], [], []); |
86 expect_sourceQueue([source1]); | 87 expect_sourceQueue([source1]); |
87 // add source2 | 88 // add source2 |
88 manager.applyChange([source2], [], []); | 89 manager.applyChange([source2], [], []); |
89 expect_sourceQueue([source1, source2]); | 90 expect_sourceQueue([source1, source2]); |
90 } | 91 } |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 errors = getCacheEntry(source).getValue(ANALYSIS_OPTIONS_ERRORS); | 291 errors = getCacheEntry(source).getValue(ANALYSIS_OPTIONS_ERRORS); |
291 } | 292 } |
292 return new AnalysisErrorInfoImpl( | 293 return new AnalysisErrorInfoImpl( |
293 errors, getCacheEntry(source).getValue(LINE_INFO)); | 294 errors, getCacheEntry(source).getValue(LINE_INFO)); |
294 } | 295 } |
295 | 296 |
296 @override | 297 @override |
297 ChangeNoticeImpl getNotice(Source source) => | 298 ChangeNoticeImpl getNotice(Source source) => |
298 _pendingNotices.putIfAbsent(source, () => new ChangeNoticeImpl(source)); | 299 _pendingNotices.putIfAbsent(source, () => new ChangeNoticeImpl(source)); |
299 } | 300 } |
OLD | NEW |