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

Side by Side Diff: pkg/analysis_server/test/integration/support/integration_tests.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 import 'dart:collection'; 6 import 'dart:collection';
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:analysis_server/protocol/protocol_constants.dart';
10 import 'package:analysis_server/protocol/protocol_generated.dart'; 11 import 'package:analysis_server/protocol/protocol_generated.dart';
11 import 'package:analysis_server/src/constants.dart';
12 import 'package:analyzer_plugin/protocol/protocol_common.dart'; 12 import 'package:analyzer_plugin/protocol/protocol_common.dart';
13 import 'package:path/path.dart'; 13 import 'package:path/path.dart';
14 import 'package:test/test.dart'; 14 import 'package:test/test.dart';
15 15
16 import 'integration_test_methods.dart'; 16 import 'integration_test_methods.dart';
17 import 'protocol_matchers.dart'; 17 import 'protocol_matchers.dart';
18 18
19 const Matcher isBool = const isInstanceOf<bool>(); 19 const Matcher isBool = const isInstanceOf<bool>();
20 20
21 const Matcher isInt = const isInstanceOf<int>(); 21 const Matcher isInt = const isInstanceOf<int>();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 */ 118 */
119 List<String> lastAnalyzedFiles; 119 List<String> lastAnalyzedFiles;
120 120
121 /** 121 /**
122 * True if the teardown process should skip sending a "server.shutdown" 122 * True if the teardown process should skip sending a "server.shutdown"
123 * request (e.g. because the server is known to have already shutdown). 123 * request (e.g. because the server is known to have already shutdown).
124 */ 124 */
125 bool skipShutdown = false; 125 bool skipShutdown = false;
126 126
127 /** 127 /**
128 * True if we are currently subscribed to [SERVER_STATUS] updates. 128 * True if we are currently subscribed to [SERVER_NOTIFICATION_STATUS] updates .
129 */ 129 */
130 bool _subscribedToServerStatus = false; 130 bool _subscribedToServerStatus = false;
131 131
132 AbstractAnalysisServerIntegrationTest() { 132 AbstractAnalysisServerIntegrationTest() {
133 initializeInttestMixin(); 133 initializeInttestMixin();
134 } 134 }
135 135
136 /** 136 /**
137 * Return a future which will complete when a 'server.status' notification is 137 * Return a future which will complete when a 'server.status' notification is
138 * received from the server with 'analyzing' set to false. 138 * received from the server with 'analyzing' set to false.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 * relative to [sourceDirectory]. On Windows any forward slashes in 233 * relative to [sourceDirectory]. On Windows any forward slashes in
234 * [relativePath] are converted to backslashes. 234 * [relativePath] are converted to backslashes.
235 */ 235 */
236 String sourcePath(String relativePath) { 236 String sourcePath(String relativePath) {
237 return join(sourceDirectory.path, relativePath.replaceAll('/', separator)); 237 return join(sourceDirectory.path, relativePath.replaceAll('/', separator));
238 } 238 }
239 239
240 /** 240 /**
241 * Send the server an 'analysis.setAnalysisRoots' command directing it to 241 * Send the server an 'analysis.setAnalysisRoots' command directing it to
242 * analyze [sourceDirectory]. If [subscribeStatus] is true (the default), 242 * analyze [sourceDirectory]. If [subscribeStatus] is true (the default),
243 * then also enable [SERVER_STATUS] notifications so that [analysisFinished] 243 * then also enable [SERVER_NOTIFICATION_STATUS] notifications so that
244 * can be used. 244 * [analysisFinished] can be used.
245 */ 245 */
246 Future standardAnalysisSetup({bool subscribeStatus: true}) { 246 Future standardAnalysisSetup({bool subscribeStatus: true}) {
247 List<Future> futures = <Future>[]; 247 List<Future> futures = <Future>[];
248 if (subscribeStatus) { 248 if (subscribeStatus) {
249 futures.add(sendServerSetSubscriptions([ServerService.STATUS])); 249 futures.add(sendServerSetSubscriptions([ServerService.STATUS]));
250 } 250 }
251 futures.add(sendAnalysisSetAnalysisRoots([sourceDirectory.path], [])); 251 futures.add(sendAnalysisSetAnalysisRoots([sourceDirectory.path], []));
252 return Future.wait(futures); 252 return Future.wait(futures);
253 } 253 }
254 254
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 void populateMismatches(item, List<MismatchDescriber> mismatches); 982 void populateMismatches(item, List<MismatchDescriber> mismatches);
983 983
984 /** 984 /**
985 * Create a [MismatchDescriber] describing a mismatch with a simple string. 985 * Create a [MismatchDescriber] describing a mismatch with a simple string.
986 */ 986 */
987 MismatchDescriber simpleDescription(String description) => 987 MismatchDescriber simpleDescription(String description) =>
988 (Description mismatchDescription) { 988 (Description mismatchDescription) {
989 mismatchDescription.add(description); 989 mismatchDescription.add(description);
990 }; 990 };
991 } 991 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698