OLD | NEW |
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'; |
(...skipping 29 matching lines...) Expand all Loading... |
40 for (SearchResult result in results) { | 40 for (SearchResult result in results) { |
41 Element element = result.path[0]; | 41 Element element = result.path[0]; |
42 Element clazz = result.path[1]; | 42 Element clazz = result.path[1]; |
43 if (element.kind == kind && clazz.name == enclosingClass) { | 43 if (element.kind == kind && clazz.name == enclosingClass) { |
44 return result; | 44 return result; |
45 } | 45 } |
46 } | 46 } |
47 return null; | 47 return null; |
48 } | 48 } |
49 | 49 |
| 50 @override |
| 51 void setUp() { |
| 52 enableNewAnalysisDriver = true; |
| 53 super.setUp(); |
| 54 } |
| 55 |
50 test_localVariable() async { | 56 test_localVariable() async { |
51 addTestFile(''' | 57 addTestFile(''' |
52 class A { | 58 class A { |
53 main() { | 59 main() { |
54 var foo = 42; | 60 var foo = 42; |
55 } | 61 } |
56 } | 62 } |
57 '''); | 63 '''); |
58 await findMemberDeclarations('foo'); | 64 await findMemberDeclarations('foo'); |
59 expect(results, isEmpty); | 65 expect(results, isEmpty); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 class B { | 153 class B { |
148 set foo(x) {} | 154 set foo(x) {} |
149 } | 155 } |
150 '''); | 156 '''); |
151 await findMemberDeclarations('foo'); | 157 await findMemberDeclarations('foo'); |
152 expect(results, hasLength(2)); | 158 expect(results, hasLength(2)); |
153 assertHasDeclaration(ElementKind.METHOD, 'A'); | 159 assertHasDeclaration(ElementKind.METHOD, 'A'); |
154 assertHasDeclaration(ElementKind.SETTER, 'B'); | 160 assertHasDeclaration(ElementKind.SETTER, 'B'); |
155 } | 161 } |
156 } | 162 } |
OLD | NEW |