| 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 library test.domain.analysis.notification.navigation; | 5 library test.domain.analysis.notification.navigation; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 | 24 |
| 25 @ReflectiveTestCase() | 25 @ReflectiveTestCase() |
| 26 class AnalysisNotificationNavigationTest extends AbstractAnalysisTest { | 26 class AnalysisNotificationNavigationTest extends AbstractAnalysisTest { |
| 27 List<_NavigationRegion> regions; | 27 List<_NavigationRegion> regions; |
| 28 _NavigationRegion testRegion; | 28 _NavigationRegion testRegion; |
| 29 List<_NavigationTarget> testTargets; | 29 List<_NavigationTarget> testTargets; |
| 30 | 30 |
| 31 void processNotification(Notification notification) { | 31 void processNotification(Notification notification) { |
| 32 if (notification.event == NOTIFICATION_NAVIGATION) { | 32 if (notification.event == ANALYSIS_NAVIGATION) { |
| 33 String file = notification.getParameter(FILE); | 33 String file = notification.getParameter(FILE); |
| 34 if (file == testFile) { | 34 if (file == testFile) { |
| 35 regions = []; | 35 regions = []; |
| 36 List<Map<String, Object>> regionsJson = notification.getParameter(REGION
S); | 36 List<Map<String, Object>> regionsJson = notification.getParameter(REGION
S); |
| 37 for (Map<String, Object> regionJson in regionsJson) { | 37 for (Map<String, Object> regionJson in regionsJson) { |
| 38 var regionOffset = regionJson['offset']; | 38 var regionOffset = regionJson['offset']; |
| 39 var regionLength = regionJson['length']; | 39 var regionLength = regionJson['length']; |
| 40 List<_NavigationTarget> targets = []; | 40 List<_NavigationTarget> targets = []; |
| 41 for (Map<String, Object> targetJson in regionJson['targets']) { | 41 for (Map<String, Object> targetJson in regionJson['targets']) { |
| 42 var targetFile = targetJson['file']; | 42 var targetFile = targetJson['file']; |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 } | 448 } |
| 449 | 449 |
| 450 | 450 |
| 451 class _NavigationTarget { | 451 class _NavigationTarget { |
| 452 final String file; | 452 final String file; |
| 453 final int offset; | 453 final int offset; |
| 454 final int length; | 454 final int length; |
| 455 | 455 |
| 456 _NavigationTarget(this.file, this.offset, this.length); | 456 _NavigationTarget(this.file, this.offset, this.length); |
| 457 } | 457 } |
| OLD | NEW |