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:analysis_server/src/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 172 } |
173 if (exists == true) { | 173 if (exists == true) { |
174 fail('Expected to find (offset=$offset; length=$length) in\n' | 174 fail('Expected to find (offset=$offset; length=$length) in\n' |
175 '${regions.join('\n')}'); | 175 '${regions.join('\n')}'); |
176 } | 176 } |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 @reflectiveTest | 180 @reflectiveTest |
181 class AnalysisNotificationNavigationTest extends AbstractNavigationTest { | 181 class AnalysisNotificationNavigationTest extends AbstractNavigationTest { |
182 @override | 182 Completer _resultsAvailable = new Completer(); |
183 bool get enableNewAnalysisDriver => false; | |
184 | 183 |
185 Future prepareNavigation() async { | 184 Future prepareNavigation() async { |
186 addAnalysisSubscription(AnalysisService.NAVIGATION, testFile); | 185 addAnalysisSubscription(AnalysisService.NAVIGATION, testFile); |
187 await waitForTasksFinished(); | 186 await _resultsAvailable.future; |
188 assertRegionsSorted(); | 187 assertRegionsSorted(); |
189 } | 188 } |
190 | 189 |
191 void processNotification(Notification notification) { | 190 void processNotification(Notification notification) { |
192 if (notification.event == ANALYSIS_NAVIGATION) { | 191 if (notification.event == ANALYSIS_NAVIGATION) { |
193 var params = new AnalysisNavigationParams.fromNotification(notification); | 192 var params = new AnalysisNavigationParams.fromNotification(notification); |
194 if (params.file == testFile) { | 193 if (params.file == testFile) { |
195 regions = params.regions; | 194 regions = params.regions; |
196 targets = params.targets; | 195 targets = params.targets; |
197 targetFiles = params.files; | 196 targetFiles = params.files; |
| 197 _resultsAvailable.complete(null); |
198 } | 198 } |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 @override | 202 @override |
203 void setUp() { | 203 void setUp() { |
204 super.setUp(); | 204 super.setUp(); |
205 createProject(); | 205 createProject(); |
206 } | 206 } |
207 | 207 |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 } | 1026 } |
1027 | 1027 |
1028 test_var_topLevelVariable_single_notInferred() async { | 1028 test_var_topLevelVariable_single_notInferred() async { |
1029 addTestFile(''' | 1029 addTestFile(''' |
1030 var x; | 1030 var x; |
1031 '''); | 1031 '''); |
1032 await prepareNavigation(); | 1032 await prepareNavigation(); |
1033 assertNoRegionAt('var'); | 1033 assertNoRegionAt('var'); |
1034 } | 1034 } |
1035 } | 1035 } |
OLD | NEW |