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

Side by Side Diff: pkg/analysis_server/test/services/search/search_engine2_test.dart

Issue 1783503004: Listen for context add/remove and unit invalidation to update the index. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/analysis_server/test/services/index2/index2_test.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) 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.search.search_engine2; 5 library test.services.src.search.search_engine2;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/services/index2/index2.dart'; 9 import 'package:analysis_server/src/services/index2/index2.dart';
10 import 'package:analysis_server/src/services/search/search_engine.dart'; 10 import 'package:analysis_server/src/services/search/search_engine.dart';
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 @reflectiveTest 65 @reflectiveTest
66 class SearchEngineImpl2Test extends AbstractSingleUnitTest { 66 class SearchEngineImpl2Test extends AbstractSingleUnitTest {
67 Index2 index; 67 Index2 index;
68 SearchEngineImpl2 searchEngine; 68 SearchEngineImpl2 searchEngine;
69 69
70 void setUp() { 70 void setUp() {
71 super.setUp(); 71 super.setUp();
72 index = createMemoryIndex2(); 72 index = createMemoryIndex2();
73 searchEngine = new SearchEngineImpl2(context, index); 73 searchEngine = new SearchEngineImpl2(index);
74 } 74 }
75 75
76 test_searchAllSubtypes() async { 76 test_searchAllSubtypes() async {
77 _indexTestUnit(''' 77 _indexTestUnit('''
78 class T {} 78 class T {}
79 class A extends T {} 79 class A extends T {}
80 class B extends A {} 80 class B extends A {}
81 class C implements B {} 81 class C implements B {}
82 '''); 82 ''');
83 ClassElement element = findElement('T'); 83 ClassElement element = findElement('T');
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 Element element, List<ExpectedMatch> expectedMatches) async { 705 Element element, List<ExpectedMatch> expectedMatches) async {
706 List<SearchMatch> matches = await searchEngine.searchReferences(element); 706 List<SearchMatch> matches = await searchEngine.searchReferences(element);
707 _assertMatches(matches, expectedMatches); 707 _assertMatches(matches, expectedMatches);
708 } 708 }
709 709
710 static void _assertMatches( 710 static void _assertMatches(
711 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { 711 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) {
712 expect(matches, unorderedEquals(expectedMatches)); 712 expect(matches, unorderedEquals(expectedMatches));
713 } 713 }
714 } 714 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/services/index2/index2_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698