| 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.dart_work_manager_test; | 5 library test.src.task.dart_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/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart' | 9 import 'package:analyzer/src/generated/engine.dart' |
| 10 show | 10 show |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 manager.resultsComputed( | 499 manager.resultsComputed( |
| 500 new LibrarySpecificUnit(source1, source2), {RESOLVED_UNIT: unit}); | 500 new LibrarySpecificUnit(source1, source2), {RESOLVED_UNIT: unit}); |
| 501 ChangeNoticeImpl notice = context.getNotice(source2); | 501 ChangeNoticeImpl notice = context.getNotice(source2); |
| 502 expect(notice.parsedDartUnit, isNull); | 502 expect(notice.parsedDartUnit, isNull); |
| 503 expect(notice.resolvedDartUnit, unit); | 503 expect(notice.resolvedDartUnit, unit); |
| 504 expect(notice.lineInfo, lineInfo); | 504 expect(notice.lineInfo, lineInfo); |
| 505 } | 505 } |
| 506 | 506 |
| 507 void test_resultsComputed_sourceKind_isLibrary() { | 507 void test_resultsComputed_sourceKind_isLibrary() { |
| 508 manager.unknownSourceQueue.addAll([source1, source2, source3]); | 508 manager.unknownSourceQueue.addAll([source1, source2, source3]); |
| 509 when(context.shouldErrorsBeAnalyzed(source2, null)).thenReturn(true); |
| 509 manager.resultsComputed(source2, {SOURCE_KIND: SourceKind.LIBRARY}); | 510 manager.resultsComputed(source2, {SOURCE_KIND: SourceKind.LIBRARY}); |
| 510 expect_librarySourceQueue([source2]); | 511 expect_librarySourceQueue([source2]); |
| 511 expect_unknownSourceQueue([source1, source3]); | 512 expect_unknownSourceQueue([source1, source3]); |
| 512 } | 513 } |
| 513 | 514 |
| 514 void test_resultsComputed_sourceKind_isPart() { | 515 void test_resultsComputed_sourceKind_isPart() { |
| 515 manager.unknownSourceQueue.addAll([source1, source2, source3]); | 516 manager.unknownSourceQueue.addAll([source1, source2, source3]); |
| 516 manager.resultsComputed(source2, {SOURCE_KIND: SourceKind.PART}); | 517 manager.resultsComputed(source2, {SOURCE_KIND: SourceKind.PART}); |
| 517 expect_librarySourceQueue([]); | 518 expect_librarySourceQueue([]); |
| 518 expect_unknownSourceQueue([source1, source3]); | 519 expect_unknownSourceQueue([source1, source3]); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 541 } | 542 } |
| 542 | 543 |
| 543 @override | 544 @override |
| 544 ChangeNoticeImpl getNotice(Source source) { | 545 ChangeNoticeImpl getNotice(Source source) { |
| 545 return _pendingNotices.putIfAbsent( | 546 return _pendingNotices.putIfAbsent( |
| 546 source, () => new ChangeNoticeImpl(source)); | 547 source, () => new ChangeNoticeImpl(source)); |
| 547 } | 548 } |
| 548 | 549 |
| 549 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 550 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 550 } | 551 } |
| OLD | NEW |