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

Side by Side Diff: pkg/analysis_server/test/search/element_references_test.dart

Issue 1788673004: Index unqualified unresolved used names. (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
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.search.element_references; 5 library test.search.element_references;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; 9 import 'package:analysis_server/plugin/protocol/protocol.dart';
10 import 'package:analysis_server/src/services/index/index.dart'; 10 import 'package:analysis_server/src/services/index/index.dart';
(...skipping 15 matching lines...) Expand all
26 26
27 void assertHasRef(SearchResultKind kind, String search, bool isPotential) { 27 void assertHasRef(SearchResultKind kind, String search, bool isPotential) {
28 assertHasResult(kind, search); 28 assertHasResult(kind, search);
29 expect(result.isPotential, isPotential); 29 expect(result.isPotential, isPotential);
30 } 30 }
31 31
32 Future findElementReferences(String search, bool includePotential) async { 32 Future findElementReferences(String search, bool includePotential) async {
33 int offset = findOffset(search); 33 int offset = findOffset(search);
34 await waitForTasksFinished(); 34 await waitForTasksFinished();
35 Request request = new SearchFindElementReferencesParams( 35 Request request = new SearchFindElementReferencesParams(
36 testFile, offset, includePotential).toRequest('0'); 36 testFile, offset, includePotential)
37 .toRequest('0');
37 Response response = await waitResponse(request); 38 Response response = await waitResponse(request);
38 var result = new SearchFindElementReferencesResult.fromResponse(response); 39 var result = new SearchFindElementReferencesResult.fromResponse(response);
39 searchId = result.id; 40 searchId = result.id;
40 searchElement = result.element; 41 searchElement = result.element;
41 if (searchId == null) { 42 if (searchId == null) {
42 return null; 43 return null;
43 } else { 44 } else {
44 return waitForSearchResults(); 45 return waitForSearchResults();
45 } 46 }
46 } 47 }
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 { 733 {
733 assertHasResult(SearchResultKind.INVOCATION, 'test(1);'); 734 assertHasResult(SearchResultKind.INVOCATION, 'test(1);');
734 expect(result.isPotential, isFalse); 735 expect(result.isPotential, isFalse);
735 } 736 }
736 { 737 {
737 assertHasResult(SearchResultKind.INVOCATION, 'test(2);'); 738 assertHasResult(SearchResultKind.INVOCATION, 'test(2);');
738 expect(result.isPotential, isTrue); 739 expect(result.isPotential, isTrue);
739 } 740 }
740 } 741 }
741 742
742 fail_potential_method_definedInSubclass() async { 743 test_potential_method_definedInSubclass() async {
743 addTestFile(''' 744 addTestFile('''
744 class Base { 745 class Base {
745 methodInBase() { 746 methodInBase() {
746 test(1); 747 test(1);
747 } 748 }
748 } 749 }
749 class Derived extends Base { 750 class Derived extends Base {
750 test(_) {} // of Derived 751 test(_) {} // of Derived
751 methodInDerived() { 752 methodInDerived() {
752 test(2); 753 test(2);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 print(vvv); 879 print(vvv);
879 } 880 }
880 '''); 881 ''');
881 Request request = new SearchFindElementReferencesParams(testFile, 0, false) 882 Request request = new SearchFindElementReferencesParams(testFile, 0, false)
882 .toRequest('0'); 883 .toRequest('0');
883 Response response = await waitResponse(request); 884 Response response = await waitResponse(request);
884 expect(response.error, isNotNull); 885 expect(response.error, isNotNull);
885 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); 886 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED);
886 } 887 }
887 } 888 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698