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

Side by Side Diff: pkg/analysis_server/test/services/index/dart_index_contributor_test.dart

Issue 1359023002: Extract Dart specific node management into DartUnitIndexObjectManager. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.services.src.index.dart_index_contributor; 5 library test.services.src.index.dart_index_contributor;
6 6
7 import 'package:analysis_server/analysis/index/index_core.dart'; 7 import 'package:analysis_server/analysis/index/index_core.dart';
8 import 'package:analysis_server/src/services/index/index.dart'; 8 import 'package:analysis_server/src/services/index/index.dart';
9 import 'package:analysis_server/src/services/index/index_contributor.dart'; 9 import 'package:analysis_server/src/services/index/index_contributor.dart';
10 import 'package:analysis_server/src/services/index/index_store.dart'; 10 import 'package:analysis_server/src/services/index/index_store.dart';
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 List<RecordedRelation> recordedRelations = <RecordedRelation>[]; 62 List<RecordedRelation> recordedRelations = <RecordedRelation>[];
63 List<Element> recordedTopElements = <Element>[]; 63 List<Element> recordedTopElements = <Element>[];
64 64
65 CompilationUnitElement importedUnit({int index: 0}) { 65 CompilationUnitElement importedUnit({int index: 0}) {
66 List<ImportElement> imports = testLibraryElement.imports; 66 List<ImportElement> imports = testLibraryElement.imports;
67 return imports[index].importedLibrary.definingCompilationUnit; 67 return imports[index].importedLibrary.definingCompilationUnit;
68 } 68 }
69 69
70 void setUp() { 70 void setUp() {
71 super.setUp(); 71 super.setUp();
72 when(store.aboutToIndexDart(context, anyObject)).thenReturn(true); 72 when(store.aboutToIndex(context, anyObject)).thenReturn(true);
73 when(store.recordRelationship(anyObject, anyObject, anyObject)).thenInvoke( 73 when(store.recordRelationship(anyObject, anyObject, anyObject)).thenInvoke(
74 (IndexableObject indexable, RelationshipImpl relationship, 74 (IndexableObject indexable, RelationshipImpl relationship,
75 LocationImpl location) { 75 LocationImpl location) {
76 recordedRelations 76 recordedRelations
77 .add(new RecordedRelation(indexable, relationship, location)); 77 .add(new RecordedRelation(indexable, relationship, location));
78 }); 78 });
79 when(store.recordTopLevelDeclaration(anyObject)) 79 when(store.recordTopLevelDeclaration(anyObject))
80 .thenInvoke((Element element) { 80 .thenInvoke((Element element) {
81 recordedTopElements.add(element); 81 recordedTopElements.add(element);
82 }); 82 });
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 RecordedRelation(this.indexable, this.relationship, this.location); 1639 RecordedRelation(this.indexable, this.relationship, this.location);
1640 1640
1641 @override 1641 @override
1642 String toString() { 1642 String toString() {
1643 return 'RecordedRelation(indexable=$indexable; relationship=$relationship; ' 1643 return 'RecordedRelation(indexable=$indexable; relationship=$relationship; '
1644 'location=$location; flags=' 1644 'location=$location; flags='
1645 '${location.isQualified ? "Q" : ""}' 1645 '${location.isQualified ? "Q" : ""}'
1646 '${location.isResolved ? "R" : ""})'; 1646 '${location.isResolved ? "R" : ""})';
1647 } 1647 }
1648 } 1648 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698