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

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

Issue 2863593004: Remove the non-driver versions of several tests (Closed)
Patch Set: Created 3 years, 7 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analysis_server/protocol/protocol.dart'; 7 import 'package:analysis_server/protocol/protocol.dart';
8 import 'package:analysis_server/protocol/protocol_generated.dart'; 8 import 'package:analysis_server/protocol/protocol_generated.dart';
9 import 'package:test/test.dart'; 9 import 'package:test/test.dart';
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; 10 import 'package:test_reflective_loader/test_reflective_loader.dart';
11 11
12 import 'abstract_search_domain.dart'; 12 import 'abstract_search_domain.dart';
13 13
14 main() { 14 main() {
15 defineReflectiveSuite(() { 15 defineReflectiveSuite(() {
16 defineReflectiveTests(MemberReferencesTest); 16 defineReflectiveTests(MemberReferencesTest);
17 defineReflectiveTests(MemberReferencesTest_Driver);
18 }); 17 });
19 } 18 }
20 19
21 @reflectiveTest 20 @reflectiveTest
22 class MemberReferencesTest extends AbstractSearchDomainTest { 21 class MemberReferencesTest extends AbstractSearchDomainTest {
23 void assertHasRef(SearchResultKind kind, String search, bool isPotential) { 22 void assertHasRef(SearchResultKind kind, String search, bool isPotential) {
24 assertHasResult(kind, search); 23 assertHasResult(kind, search);
25 expect(result.isPotential, isPotential); 24 expect(result.isPotential, isPotential);
26 } 25 }
27 26
28 Future findMemberReferences(String name) async { 27 Future findMemberReferences(String name) async {
29 await waitForTasksFinished(); 28 await waitForTasksFinished();
30 Request request = new SearchFindMemberReferencesParams(name).toRequest('0'); 29 Request request = new SearchFindMemberReferencesParams(name).toRequest('0');
31 Response response = await waitResponse(request); 30 Response response = await waitResponse(request);
32 searchId = new SearchFindMemberReferencesResult.fromResponse(response).id; 31 searchId = new SearchFindMemberReferencesResult.fromResponse(response).id;
33 return waitForSearchResults(); 32 return waitForSearchResults();
34 } 33 }
35 34
35 @override
36 void setUp() {
37 enableNewAnalysisDriver = true;
38 super.setUp();
39 }
40
36 test_fields_explicit() async { 41 test_fields_explicit() async {
37 addTestFile(''' 42 addTestFile('''
38 class A { 43 class A {
39 var foo; 44 var foo;
40 } 45 }
41 class B { 46 class B {
42 var foo; 47 var foo;
43 } 48 }
44 mainResolved(A a, B b) { 49 mainResolved(A a, B b) {
45 a.foo = 1; 50 a.foo = 1;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 b.foo(20); 111 b.foo(20);
107 } 112 }
108 '''); 113 ''');
109 await findMemberReferences('foo'); 114 await findMemberReferences('foo');
110 assertNoResult(SearchResultKind.INVOCATION, 'foo(1)'); 115 assertNoResult(SearchResultKind.INVOCATION, 'foo(1)');
111 assertNoResult(SearchResultKind.INVOCATION, 'foo(2)'); 116 assertNoResult(SearchResultKind.INVOCATION, 'foo(2)');
112 assertHasRef(SearchResultKind.INVOCATION, 'foo(10)', true); 117 assertHasRef(SearchResultKind.INVOCATION, 'foo(10)', true);
113 assertHasRef(SearchResultKind.INVOCATION, 'foo(20)', true); 118 assertHasRef(SearchResultKind.INVOCATION, 'foo(20)', true);
114 } 119 }
115 } 120 }
116
117 @reflectiveTest
118 class MemberReferencesTest_Driver extends MemberReferencesTest {
119 @override
120 void setUp() {
121 enableNewAnalysisDriver = true;
122 super.setUp();
123 }
124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698