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

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

Issue 477323005: Use generated classes to create requests in analysis server unit tests. (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.analysis.get_errors; 5 library test.analysis.get_errors;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/domain_analysis.dart'; 10 import 'package:analysis_server/src/domain_analysis.dart';
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // wait for an error response 112 // wait for an error response
113 return serverChannel.waitForResponse(request).then((Response response) { 113 return serverChannel.waitForResponse(request).then((Response response) {
114 expect(response.getResult(ERRORS), isEmpty); 114 expect(response.getResult(ERRORS), isEmpty);
115 RequestError error = response.error; 115 RequestError error = response.error;
116 expect(error, isNotNull); 116 expect(error, isNotNull);
117 expect(error.code, 'GET_ERRORS_ERROR'); 117 expect(error.code, 'GET_ERRORS_ERROR');
118 }); 118 });
119 } 119 }
120 120
121 Request _createGetErrorsRequest() { 121 Request _createGetErrorsRequest() {
122 Request request = new Request(requestId, ANALYSIS_GET_ERRORS); 122 return new AnalysisGetErrorsParams(testFile).toRequest(requestId);
123 request.setParameter(FILE, testFile);
124 return request;
125 } 123 }
126 124
127 Future<List<AnalysisError>> _getErrors(String file) { 125 Future<List<AnalysisError>> _getErrors(String file) {
128 Request request = _createGetErrorsRequest(); 126 Request request = _createGetErrorsRequest();
129 return serverChannel.sendRequest(request).then((Response response) { 127 return serverChannel.sendRequest(request).then((Response response) {
130 return new AnalysisGetErrorsResult.fromResponse(response).errors; 128 return new AnalysisGetErrorsResult.fromResponse(response).errors;
131 }); 129 });
132 } 130 }
133 } 131 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/protocol.dart ('k') | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698