| Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/index/IndexContributorTest.java
|
| ===================================================================
|
| --- editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/index/IndexContributorTest.java (revision 22658)
|
| +++ editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/index/IndexContributorTest.java (working copy)
|
| @@ -200,43 +200,6 @@
|
| private IndexStore store = mock(IndexStore.class);
|
| private IndexContributor index = new IndexContributor(store);
|
|
|
| - /**
|
| - * TODO(scheglov) enable this test after analyzer fix
|
| - * <p>
|
| - * https://code.google.com/p/dart/issues/detail?id=10521
|
| - */
|
| - public void fail_isReferencedBy_ImportElement_withPrefix() throws Exception {
|
| - setFileContent(
|
| - "Lib.dart",
|
| - makeSource(
|
| - "// filler filler filler filler filler filler filler filler filler filler",
|
| - "library lib;",
|
| - "var myVar;"));
|
| - parseTestUnit(
|
| - "// filler filler filler filler filler filler filler filler filler filler",
|
| - "import 'Lib.dart' as pref;",
|
| - "main() {",
|
| - " pref.myVar = 1;",
|
| - "}",
|
| - "");
|
| - // set elements
|
| - Element mainElement = findElement("main(");
|
| - ImportElement importElement = (ImportElement) findNode(
|
| - "import 'Lib.dart",
|
| - ImportDirective.class).getElement();
|
| - // index
|
| - index.visitCompilationUnit(testUnit);
|
| - // verify
|
| - // TODO(scheglov) we have problem - PrefixElement recorded for "pref" and we don't know
|
| - // which ImportElement it is.
|
| -// List<RecordedRelation> relations = captureRecordedRelations();
|
| -// assertRecordedRelation(
|
| -// relations,
|
| -// importElement,
|
| -// IndexConstants.IS_REFERENCED_BY,
|
| -// new ExpectedLocation(mainElement, findOffset("pref.myVar"), "pref"));
|
| - }
|
| -
|
| public void test_createElementLocation() throws Exception {
|
| ElementLocation elementLocation = mock(ElementLocation.class);
|
| Element element = mockElement(Element.class, elementLocation, 42, "myName");
|
| @@ -908,6 +871,43 @@
|
| new ExpectedLocation(mainElement, findOffset("myVar = 1"), ""));
|
| }
|
|
|
| + /**
|
| + * TODO(scheglov) enable this test after analyzer fix
|
| + * <p>
|
| + * https://code.google.com/p/dart/issues/detail?id=10521
|
| + */
|
| + public void test_isReferencedBy_ImportElement_withPrefix() throws Exception {
|
| + setFileContent(
|
| + "Lib.dart",
|
| + makeSource(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "library lib;",
|
| + "var myVar;"));
|
| + parseTestUnit(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "import 'Lib.dart' as pref;",
|
| + "main() {",
|
| + " pref.myVar = 1;",
|
| + "}",
|
| + "");
|
| + // set elements
|
| + Element mainElement = findElement("main(");
|
| + ImportElement importElement = (ImportElement) findNode(
|
| + "import 'Lib.dart",
|
| + ImportDirective.class).getElement();
|
| + // index
|
| + index.visitCompilationUnit(testUnit);
|
| + // verify
|
| + // TODO(scheglov) we have problem - PrefixElement recorded for "pref" and we don't know
|
| + // which ImportElement it is.
|
| +// List<RecordedRelation> relations = captureRecordedRelations();
|
| +// assertRecordedRelation(
|
| +// relations,
|
| +// importElement,
|
| +// IndexConstants.IS_REFERENCED_BY,
|
| +// new ExpectedLocation(mainElement, findOffset("pref.myVar"), "pref"));
|
| + }
|
| +
|
| public void test_isReferencedBy_LabelElement() throws Exception {
|
| parseTestUnit(
|
| "// filler filler filler filler filler filler filler filler filler filler",
|
|
|