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

Side by Side Diff: pkg/analysis_server/test/integration/integration_tests.dart

Issue 482573004: Change analysis server protocol to omit empty lists when optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 library test.integration.analysis; 5 library test.integration.analysis;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 /** 90 /**
91 * Send the server an 'analysis.setAnalysisRoots' command directing it to 91 * Send the server an 'analysis.setAnalysisRoots' command directing it to
92 * analyze [sourceDirectory]. If [subscribeStatus] is true (the default), 92 * analyze [sourceDirectory]. If [subscribeStatus] is true (the default),
93 * then also enable [SERVER_STATUS] notifications so that [analysisFinished] 93 * then also enable [SERVER_STATUS] notifications so that [analysisFinished]
94 * can be used. 94 * can be used.
95 */ 95 */
96 Future standardAnalysisSetup({bool subscribeStatus: true}) { 96 Future standardAnalysisSetup({bool subscribeStatus: true}) {
97 List<Future> futures = <Future>[]; 97 List<Future> futures = <Future>[];
98 if (subscribeStatus) { 98 if (subscribeStatus) {
99 futures.add(sendServerSetSubscriptions(['STATUS'])); 99 futures.add(sendServerSetSubscriptions(subscriptions: ['STATUS']));
100 } 100 }
101 futures.add(sendAnalysisSetAnalysisRoots([sourceDirectory.path], [])); 101 futures.add(sendAnalysisSetAnalysisRoots(included: [sourceDirectory.path]));
102 return Future.wait(futures); 102 return Future.wait(futures);
103 } 103 }
104 104
105 /** 105 /**
106 * Return a future which will complete when a 'server.status' notification is 106 * Return a future which will complete when a 'server.status' notification is
107 * received from the server with 'analyzing' set to false. 107 * received from the server with 'analyzing' set to false.
108 * 108 *
109 * The future will only be completed by 'server.status' notifications that are 109 * The future will only be completed by 'server.status' notifications that are
110 * received after this function call. So it is safe to use this getter 110 * received after this function call. So it is safe to use this getter
111 * multiple times in one test; each time it is used it will wait afresh for 111 * multiple times in one test; each time it is used it will wait afresh for
(...skipping 24 matching lines...) Expand all
136 136
137 /** 137 /**
138 * Print out any messages exchanged with the server. If some messages have 138 * Print out any messages exchanged with the server. If some messages have
139 * already been exchanged with the server, they are printed out immediately. 139 * already been exchanged with the server, they are printed out immediately.
140 */ 140 */
141 void debugStdio() { 141 void debugStdio() {
142 server.debugStdio(); 142 server.debugStdio();
143 } 143 }
144 144
145 @override 145 @override
146 Future sendServerSetSubscriptions(List<String> subscriptions, {bool 146 Future sendServerSetSubscriptions({List<String> subscriptions, bool
147 checkTypes: true}) { 147 checkTypes: true}) {
148 _subscribedToServerStatus = subscriptions.contains('STATUS'); 148 _subscribedToServerStatus = subscriptions != null &&
149 return super.sendServerSetSubscriptions(subscriptions, checkTypes: 149 subscriptions.contains('STATUS');
150 checkTypes); 150 return super.sendServerSetSubscriptions(subscriptions: subscriptions,
151 checkTypes: checkTypes);
151 } 152 }
152 153
153 /** 154 /**
154 * The server is automatically started before every test, and a temporary 155 * The server is automatically started before every test, and a temporary
155 * [sourceDirectory] is created. 156 * [sourceDirectory] is created.
156 */ 157 */
157 Future setUp() { 158 Future setUp() {
158 sourceDirectory = Directory.systemTemp.createTempSync('analysisServer'); 159 sourceDirectory = Directory.systemTemp.createTempSync('analysisServer');
159 160
160 onAnalysisErrors.listen((params) { 161 onAnalysisErrors.listen((params) {
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 */ 830 */
830 void _recordStdio(String line) { 831 void _recordStdio(String line) {
831 double elapsedTime = _time.elapsedTicks / _time.frequency; 832 double elapsedTime = _time.elapsedTicks / _time.frequency;
832 line = "$elapsedTime: $line"; 833 line = "$elapsedTime: $line";
833 if (_debuggingStdio) { 834 if (_debuggingStdio) {
834 print(line); 835 print(line);
835 } 836 }
836 _recordedStdio.add(line); 837 _recordedStdio.add(line);
837 } 838 }
838 } 839 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698