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

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

Issue 2939803002: Convert more tests to use the new driver (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/services/index/index_test.dart
diff --git a/pkg/analysis_server/test/services/index/index_test.dart b/pkg/analysis_server/test/services/index/index_test.dart
index 4c244ea6fad71622e04614652f7a082d02d32ba1..4976177c553bf553597667d50153fc1ba32f6eef 100644
--- a/pkg/analysis_server/test/services/index/index_test.dart
+++ b/pkg/analysis_server/test/services/index/index_test.dart
@@ -25,9 +25,6 @@ main() {
class IndexTest extends AbstractSingleUnitTest {
Index index = createMemoryIndex();
- @override
- bool get enableNewAnalysisDriver => false;
-
/**
* Return the [Location] with given properties, or fail.
*/
@@ -168,7 +165,8 @@ class C extends A {} // C
main(int a, int b) {
}
''');
- ClassElement intElement = context.typeProvider.intType.element;
+ ClassElement intElement =
+ testUnitElement.context.typeProvider.intType.element;
List<Location> locations = await index.getRelations(
intElement, IndexRelationKind.IS_REFERENCED_BY);
findLocationTest(locations, 'int a', false);
@@ -311,7 +309,7 @@ class A {}
expect(await index.getDefinedNames(regExp, IndexNameKind.topLevel),
hasLength(1));
// remove the context - no top-level declarations
- index.removeContext(context);
+ index.removeContext(testUnitElement.context);
expect(
await index.getDefinedNames(regExp, IndexNameKind.topLevel), isEmpty);
}
@@ -332,7 +330,7 @@ class A {}
unorderedEquals([sourceA.uri.toString(), sourceB.uri.toString()]));
}
// remove a.dart - no a.dart location
- index.removeUnit(context, sourceA, sourceA);
+ index.removeUnit(unitA.element.context, sourceA, sourceA);
{
List<Location> locations =
await index.getDefinedNames(regExp, IndexNameKind.topLevel);

Powered by Google App Engine
This is Rietveld 408576698