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(AnalysisNotificationHighlightsTest); | 18 defineReflectiveTests(AnalysisNotificationHighlightsTest); |
19 defineReflectiveTests(HighlightTypeTest); | 19 defineReflectiveTests(HighlightTypeTest); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 return length; | 90 return length; |
91 } | 91 } |
92 | 92 |
93 Future prepareHighlights() { | 93 Future prepareHighlights() { |
94 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); | 94 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); |
95 return _resultsAvailable.future; | 95 return _resultsAvailable.future; |
96 } | 96 } |
97 | 97 |
98 void processNotification(Notification notification) { | 98 void processNotification(Notification notification) { |
99 if (notification.event == ANALYSIS_HIGHLIGHTS) { | 99 if (notification.event == ANALYSIS_NOTIFICATION_HIGHLIGHTS) { |
100 var params = new AnalysisHighlightsParams.fromNotification(notification); | 100 var params = new AnalysisHighlightsParams.fromNotification(notification); |
101 if (params.file == testFile) { | 101 if (params.file == testFile) { |
102 regions = params.regions; | 102 regions = params.regions; |
103 _resultsAvailable.complete(null); | 103 _resultsAvailable.complete(null); |
104 } | 104 } |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 @override | 108 @override |
109 void setUp() { | 109 void setUp() { |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 void test_toString() { | 953 void test_toString() { |
954 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS'); | 954 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS'); |
955 } | 955 } |
956 | 956 |
957 void test_valueOf_unknown() { | 957 void test_valueOf_unknown() { |
958 expect(() { | 958 expect(() { |
959 new HighlightRegionType('no-such-type'); | 959 new HighlightRegionType('no-such-type'); |
960 }, throws); | 960 }, throws); |
961 } | 961 } |
962 } | 962 } |
OLD | NEW |