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.abstract; | 5 library test.domain.analysis.abstract; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 int offset = testCode.indexOf(search); | 164 int offset = testCode.indexOf(search); |
165 expect(offset, isNot(-1)); | 165 expect(offset, isNot(-1)); |
166 return offset; | 166 return offset; |
167 } | 167 } |
168 | 168 |
169 /** | 169 /** |
170 * Validates that the given [request] is handled successfully. | 170 * Validates that the given [request] is handled successfully. |
171 */ | 171 */ |
172 Response handleSuccessfulRequest(Request request) { | 172 Response handleSuccessfulRequest(Request request) { |
173 Response response = handler.handleRequest(request); | 173 Response response = handler.handleRequest(request); |
174 expect(response, isResponseSuccess('0')); | 174 expect(response, isResponseSuccess(request.id)); |
175 return response; | 175 return response; |
176 } | 176 } |
177 | 177 |
178 String modifyTestFile(String content) { | 178 String modifyTestFile(String content) { |
179 addFile(testFile, content); | 179 addFile(testFile, content); |
180 this.testCode = content; | 180 this.testCode = content; |
181 return testFile; | 181 return testFile; |
182 } | 182 } |
183 | 183 |
184 void processNotification(Notification notification) { | 184 void processNotification(Notification notification) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 227 } |
228 | 228 |
229 /** | 229 /** |
230 * Completes with a successful [Response] for the given [request]. | 230 * Completes with a successful [Response] for the given [request]. |
231 * Otherwise fails. | 231 * Otherwise fails. |
232 */ | 232 */ |
233 Future<Response> waitResponse(Request request) async { | 233 Future<Response> waitResponse(Request request) async { |
234 return serverChannel.sendRequest(request); | 234 return serverChannel.sendRequest(request); |
235 } | 235 } |
236 } | 236 } |
OLD | NEW |