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

Side by Side Diff: pkg/analysis_server/test/edit/fixes_test.dart

Issue 2890163004: Add requestTime to responses (Closed)
Patch Set: Created 3 years, 7 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_generated.dart'; 8 import 'package:analysis_server/protocol/protocol_generated.dart';
9 import 'package:analysis_server/src/edit/edit_domain.dart'; 9 import 'package:analysis_server/src/edit/edit_domain.dart';
10 import 'package:analysis_server/src/plugin/plugin_manager.dart'; 10 import 'package:analysis_server/src/plugin/plugin_manager.dart';
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 test_fromPlugins() async { 56 test_fromPlugins() async {
57 PluginInfo info = new DiscoveredPluginInfo('a', 'b', 'c', null, null); 57 PluginInfo info = new DiscoveredPluginInfo('a', 'b', 'c', null, null);
58 plugin.AnalysisErrorFixes fixes = new plugin.AnalysisErrorFixes( 58 plugin.AnalysisErrorFixes fixes = new plugin.AnalysisErrorFixes(
59 new AnalysisError(AnalysisErrorSeverity.ERROR, AnalysisErrorType.HINT, 59 new AnalysisError(AnalysisErrorSeverity.ERROR, AnalysisErrorType.HINT,
60 new Location('', 0, 0, 0, 0), 'message', 'code')); 60 new Location('', 0, 0, 0, 0), 'message', 'code'));
61 plugin.EditGetFixesResult result = 61 plugin.EditGetFixesResult result =
62 new plugin.EditGetFixesResult(<plugin.AnalysisErrorFixes>[fixes]); 62 new plugin.EditGetFixesResult(<plugin.AnalysisErrorFixes>[fixes]);
63 pluginManager.broadcastResults = <PluginInfo, Future<plugin.Response>>{ 63 pluginManager.broadcastResults = <PluginInfo, Future<plugin.Response>>{
64 info: new Future.value(result.toResponse('-')) 64 info: new Future.value(result.toResponse('-', 1))
65 }; 65 };
66 66
67 createProject(); 67 createProject();
68 addTestFile('main() {}'); 68 addTestFile('main() {}');
69 await waitForTasksFinished(); 69 await waitForTasksFinished();
70 List<AnalysisErrorFixes> errorFixes = await _getFixesAt('in('); 70 List<AnalysisErrorFixes> errorFixes = await _getFixesAt('in(');
71 expect(errorFixes, hasLength(1)); 71 expect(errorFixes, hasLength(1));
72 } 72 }
73 73
74 test_hasFixes() async { 74 test_hasFixes() async {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 return await _getFixes(offset); 158 return await _getFixes(offset);
159 } 159 }
160 160
161 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) { 161 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) {
162 AnalysisError error = fixes.error; 162 AnalysisError error = fixes.error;
163 expect(error.severity, AnalysisErrorSeverity.ERROR); 163 expect(error.severity, AnalysisErrorSeverity.ERROR);
164 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR); 164 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR);
165 expect(fixes.fixes, hasLength(1)); 165 expect(fixes.fixes, hasLength(1));
166 } 166 }
167 } 167 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/edit/assists_test.dart ('k') | pkg/analysis_server/test/src/domain_abstract_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698