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

Unified Diff: pkg/analysis_server/test/edit/fixes_test.dart

Issue 2832643005: Add plugin support for getAssists (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/edit/assists_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/edit/fixes_test.dart
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index 3cd22c04b56a24a76a2f94b94fcff2ff11d8c1da..ff8d246f9acfa5cadbeece2397731678fc6789fe 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -2,12 +2,14 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library test.edit.fixes;
-
import 'dart:async';
import 'package:analysis_server/plugin/protocol/protocol.dart';
import 'package:analysis_server/src/edit/edit_domain.dart';
+import 'package:analysis_server/src/plugin/plugin_manager.dart';
+import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
+import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
+import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin;
import 'package:plugin/manager.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -24,6 +26,7 @@ main() {
class FixesTest extends AbstractAnalysisTest {
@override
void setUp() {
+ enableNewAnalysisDriver = true;
super.setUp();
ExtensionManager manager = new ExtensionManager();
manager.processPlugins([server.serverPlugin]);
@@ -49,6 +52,28 @@ main() {
expect(fixes[1].message, matches('Create class'));
}
+ test_fromPlugins() async {
+ PluginInfo info = new PluginInfo('a', 'b', 'c', null, null);
+ plugin.AnalysisErrorFixes fixes = new plugin.AnalysisErrorFixes(
+ new plugin.AnalysisError(
+ plugin.AnalysisErrorSeverity.ERROR,
+ plugin.AnalysisErrorType.HINT,
+ new plugin.Location('', 0, 0, 0, 0),
+ 'message',
+ 'code'));
+ plugin.EditGetFixesResult result =
+ new plugin.EditGetFixesResult(<plugin.AnalysisErrorFixes>[fixes]);
+ pluginManager.broadcastResults = <PluginInfo, Future<plugin.Response>>{
+ info: new Future.value(result.toResponse('-'))
+ };
+
+ createProject();
+ addTestFile('main() {}');
+ await waitForTasksFinished();
+ List<AnalysisErrorFixes> errorFixes = await _getFixesAt('in(');
+ expect(errorFixes, hasLength(1));
+ }
+
test_hasFixes() async {
createProject();
addTestFile('''
« no previous file with comments | « pkg/analysis_server/test/edit/assists_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698