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

Unified Diff: pkg/analysis_server/test/services/index/dart_index_contributor_test.dart

Issue 1471073002: Make index provisional API. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
index 1830a285943c337c44bc75d23d0030ba990dc406..9ba6cae2f5cbb2b74559cb8e98893b540c8a3e0a 100644
--- a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
+++ b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
@@ -4,7 +4,7 @@
library test.services.src.index.dart_index_contributor;
-import 'package:analysis_server/plugin/index/index_core.dart';
+import 'package:analysis_server/src/provisional/index/index_core.dart';
import 'package:analysis_server/src/services/index/index.dart';
import 'package:analysis_server/src/services/index/index_contributor.dart';
import 'package:analysis_server/src/services/index/index_store.dart';
@@ -94,27 +94,6 @@ class DartUnitContributorTest extends AbstractSingleUnitTest {
});
}
- void test_isReferencedBy_PrefixElement() {
- _indexTestUnit('''
-import 'dart:async' as ppp;
-main() {
- ppp.Future a;
- ppp.Stream b;
-}
-''');
- // prepare elements
- PrefixElement element = findNodeElementAtString('ppp;');
- Element elementA = findElement('a');
- Element elementB = findElement('b');
- IndexableElement indexable = new IndexableElement(element);
- // verify
- _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
- _expectedLocation(elementA, 'ppp.Future'));
- _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
- _expectedLocation(elementB, 'ppp.Stream'));
- _assertNoRecordedRelation(indexable, null, _expectedLocation(null, 'ppp;'));
- }
-
void test_bad_unresolvedFieldFormalParameter() {
verifyNoTestUnitErrors = false;
_indexTestUnit('''
@@ -1423,6 +1402,27 @@ main() {
_expectedLocation(mainElement, 'p: 1'));
}
+ void test_isReferencedBy_PrefixElement() {
+ _indexTestUnit('''
+import 'dart:async' as ppp;
+main() {
+ ppp.Future a;
+ ppp.Stream b;
+}
+''');
+ // prepare elements
+ PrefixElement element = findNodeElementAtString('ppp;');
+ Element elementA = findElement('a');
+ Element elementB = findElement('b');
+ IndexableElement indexable = new IndexableElement(element);
+ // verify
+ _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
+ _expectedLocation(elementA, 'ppp.Future'));
+ _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
+ _expectedLocation(elementB, 'ppp.Stream'));
+ _assertNoRecordedRelation(indexable, null, _expectedLocation(null, 'ppp;'));
+ }
+
void test_isReferencedBy_TopLevelVariableElement() {
addSource(
'/lib.dart',

Powered by Google App Engine
This is Rietveld 408576698