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_constants.dart'; |
8 import 'package:analysis_server/protocol/protocol_generated.dart'; | 9 import 'package:analysis_server/protocol/protocol_generated.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'; |
11 import 'package:test/test.dart'; | 11 import 'package:test/test.dart'; |
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
13 | 13 |
14 import '../analysis_abstract.dart'; | 14 import '../analysis_abstract.dart'; |
15 | 15 |
16 main() { | 16 main() { |
17 defineReflectiveSuite(() { | 17 defineReflectiveSuite(() { |
18 defineReflectiveTests(AnalysisNotificationNavigationTest); | 18 defineReflectiveTests(AnalysisNotificationNavigationTest); |
19 }); | 19 }); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 class AnalysisNotificationNavigationTest extends AbstractNavigationTest { | 181 class AnalysisNotificationNavigationTest extends AbstractNavigationTest { |
182 Completer _resultsAvailable = new Completer(); | 182 Completer _resultsAvailable = new Completer(); |
183 | 183 |
184 Future prepareNavigation() async { | 184 Future prepareNavigation() async { |
185 addAnalysisSubscription(AnalysisService.NAVIGATION, testFile); | 185 addAnalysisSubscription(AnalysisService.NAVIGATION, testFile); |
186 await _resultsAvailable.future; | 186 await _resultsAvailable.future; |
187 assertRegionsSorted(); | 187 assertRegionsSorted(); |
188 } | 188 } |
189 | 189 |
190 void processNotification(Notification notification) { | 190 void processNotification(Notification notification) { |
191 if (notification.event == ANALYSIS_NAVIGATION) { | 191 if (notification.event == ANALYSIS_NOTIFICATION_NAVIGATION) { |
192 var params = new AnalysisNavigationParams.fromNotification(notification); | 192 var params = new AnalysisNavigationParams.fromNotification(notification); |
193 if (params.file == testFile) { | 193 if (params.file == testFile) { |
194 regions = params.regions; | 194 regions = params.regions; |
195 targets = params.targets; | 195 targets = params.targets; |
196 targetFiles = params.files; | 196 targetFiles = params.files; |
197 _resultsAvailable.complete(null); | 197 _resultsAvailable.complete(null); |
198 } | 198 } |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
(...skipping 824 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 |