Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: pkg/analysis_server/test/analysis/notification_highlights_test2.dart

Issue 2960073002: Generate constants in server as we do in plugin (Closed)
Patch Set: improve names Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 void test_toString() { 1104 void test_toString() {
1105 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS'); 1105 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS');
1106 } 1106 }
1107 1107
1108 void test_valueOf_unknown() { 1108 void test_valueOf_unknown() {
1109 expect(() { 1109 expect(() {
1110 new HighlightRegionType('no-such-type'); 1110 new HighlightRegionType('no-such-type');
1111 }, throws); 1111 }, throws);
1112 } 1112 }
1113 } 1113 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698