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.html_work_manager_test; | 5 library analyzer.test.src.task.html_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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 expect(manager.sourceQueue, unorderedEquals(sources)); | 56 expect(manager.sourceQueue, unorderedEquals(sources)); |
57 } | 57 } |
58 | 58 |
59 void setUp() { | 59 void setUp() { |
60 cache = context.analysisCache; | 60 cache = context.analysisCache; |
61 manager = new HtmlWorkManager(context); | 61 manager = new HtmlWorkManager(context); |
62 entry1 = context.getCacheEntry(source1); | 62 entry1 = context.getCacheEntry(source1); |
63 entry2 = context.getCacheEntry(source2); | 63 entry2 = context.getCacheEntry(source2); |
64 entry3 = context.getCacheEntry(source3); | 64 entry3 = context.getCacheEntry(source3); |
65 entry4 = context.getCacheEntry(source4); | 65 entry4 = context.getCacheEntry(source4); |
| 66 when(context.canonicalizeTarget(anyObject)).thenInvoke((target) => target); |
66 } | 67 } |
67 | 68 |
68 void test_applyChange_add() { | 69 void test_applyChange_add() { |
69 // add source1 | 70 // add source1 |
70 manager.applyChange([source1], [], []); | 71 manager.applyChange([source1], [], []); |
71 expect_sourceQueue([source1]); | 72 expect_sourceQueue([source1]); |
72 // add source2 | 73 // add source2 |
73 manager.applyChange([source2], [], []); | 74 manager.applyChange([source2], [], []); |
74 expect_sourceQueue([source1, source2]); | 75 expect_sourceQueue([source1, source2]); |
75 } | 76 } |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 return new AnalysisErrorInfoImpl( | 341 return new AnalysisErrorInfoImpl( |
341 errors, getCacheEntry(source).getValue(LINE_INFO)); | 342 errors, getCacheEntry(source).getValue(LINE_INFO)); |
342 } | 343 } |
343 | 344 |
344 @override | 345 @override |
345 ChangeNoticeImpl getNotice(Source source) { | 346 ChangeNoticeImpl getNotice(Source source) { |
346 return _pendingNotices.putIfAbsent( | 347 return _pendingNotices.putIfAbsent( |
347 source, () => new ChangeNoticeImpl(source)); | 348 source, () => new ChangeNoticeImpl(source)); |
348 } | 349 } |
349 } | 350 } |
OLD | NEW |