| 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('''
|
|
|