Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: pkg/analyzer/test/src/task/dart_work_manager_test.dart

Issue 2188523004: DartWorkManager.getLibrariesContainingPart() should ask the ResultProvider for CONTAINING_LIBRARIES. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/task/dart_work_manager.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 new AnalysisError(source1, 1, 0, ScannerErrorCode.MISSING_DIGIT); 322 new AnalysisError(source1, 1, 0, ScannerErrorCode.MISSING_DIGIT);
323 AnalysisError error2 = 323 AnalysisError error2 =
324 new AnalysisError(source1, 2, 0, ScannerErrorCode.MISSING_DIGIT); 324 new AnalysisError(source1, 2, 0, ScannerErrorCode.MISSING_DIGIT);
325 when(context.getLibrariesContaining(source1)).thenReturn([source2]); 325 when(context.getLibrariesContaining(source1)).thenReturn([source2]);
326 entry1.setValue(DART_ERRORS, <AnalysisError>[error1, error2], []); 326 entry1.setValue(DART_ERRORS, <AnalysisError>[error1, error2], []);
327 List<AnalysisError> errors = manager.getErrors(source1); 327 List<AnalysisError> errors = manager.getErrors(source1);
328 expect(errors, unorderedEquals([error1, error2])); 328 expect(errors, unorderedEquals([error1, error2]));
329 } 329 }
330 330
331 void test_getLibrariesContainingPart() { 331 void test_getLibrariesContainingPart() {
332 when(context.aboutToComputeResult(anyObject, anyObject)).thenReturn(false);
332 Source part1 = new TestSource('part1.dart'); 333 Source part1 = new TestSource('part1.dart');
333 Source part2 = new TestSource('part2.dart'); 334 Source part2 = new TestSource('part2.dart');
334 Source part3 = new TestSource('part3.dart'); 335 Source part3 = new TestSource('part3.dart');
335 Source library1 = new TestSource('library1.dart'); 336 Source library1 = new TestSource('library1.dart');
336 Source library2 = new TestSource('library2.dart'); 337 Source library2 = new TestSource('library2.dart');
337 manager.partLibrariesMap[part1] = [library1, library2]; 338 manager.partLibrariesMap[part1] = [library1, library2];
338 manager.partLibrariesMap[part2] = [library2]; 339 manager.partLibrariesMap[part2] = [library2];
339 manager.libraryPartsMap[library1] = [part1]; 340 manager.libraryPartsMap[library1] = [part1];
340 manager.libraryPartsMap[library2] = [part1, part2]; 341 manager.libraryPartsMap[library2] = [part1, part2];
341 // getLibrariesContainingPart 342 // getLibrariesContainingPart
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 class _SourceFactoryMock extends TypedMock implements SourceFactory {} 822 class _SourceFactoryMock extends TypedMock implements SourceFactory {}
822 823
823 class _SourceMock extends TypedMock implements Source { 824 class _SourceMock extends TypedMock implements Source {
824 final String shortName; 825 final String shortName;
825 _SourceMock(this.shortName); 826 _SourceMock(this.shortName);
826 @override 827 @override
827 String get fullName => '/' + shortName; 828 String get fullName => '/' + shortName;
828 @override 829 @override
829 String toString() => fullName; 830 String toString() => fullName;
830 } 831 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/dart_work_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698