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.dart_work_manager_test; | 5 library analyzer.test.src.task.dart_work_manager_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/src/context/cache.dart'; | 8 import 'package:analyzer/src/context/cache.dart'; |
9 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; | 9 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; |
10 import 'package:analyzer/src/generated/engine.dart' | 10 import 'package:analyzer/src/generated/engine.dart' |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 expect(manager.unknownSourceQueue, unorderedEquals(sources)); | 60 expect(manager.unknownSourceQueue, unorderedEquals(sources)); |
61 } | 61 } |
62 | 62 |
63 void setUp() { | 63 void setUp() { |
64 cache = context.analysisCache; | 64 cache = context.analysisCache; |
65 manager = new DartWorkManager(context); | 65 manager = new DartWorkManager(context); |
66 entry1 = _getOrCreateEntry(source1); | 66 entry1 = _getOrCreateEntry(source1); |
67 entry2 = _getOrCreateEntry(source2); | 67 entry2 = _getOrCreateEntry(source2); |
68 entry3 = _getOrCreateEntry(source3); | 68 entry3 = _getOrCreateEntry(source3); |
69 entry4 = _getOrCreateEntry(source4); | 69 entry4 = _getOrCreateEntry(source4); |
| 70 when(context.canonicalizeTarget(anyObject)).thenInvoke((target) => target); |
70 } | 71 } |
71 | 72 |
72 void test_applyChange_add() { | 73 void test_applyChange_add() { |
73 // add source1 | 74 // add source1 |
74 manager.applyChange([source1], [], []); | 75 manager.applyChange([source1], [], []); |
75 expect_unknownSourceQueue([source1]); | 76 expect_unknownSourceQueue([source1]); |
76 expect_librarySourceQueue([]); | 77 expect_librarySourceQueue([]); |
77 // add source2 | 78 // add source2 |
78 manager.applyChange([source2], [], []); | 79 manager.applyChange([source2], [], []); |
79 expect_librarySourceQueue([]); | 80 expect_librarySourceQueue([]); |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 class _SourceFactoryMock extends TypedMock implements SourceFactory {} | 807 class _SourceFactoryMock extends TypedMock implements SourceFactory {} |
807 | 808 |
808 class _SourceMock extends TypedMock implements Source { | 809 class _SourceMock extends TypedMock implements Source { |
809 final String shortName; | 810 final String shortName; |
810 _SourceMock(this.shortName); | 811 _SourceMock(this.shortName); |
811 @override | 812 @override |
812 String get fullName => '/' + shortName; | 813 String get fullName => '/' + shortName; |
813 @override | 814 @override |
814 String toString() => fullName; | 815 String toString() => fullName; |
815 } | 816 } |
OLD | NEW |