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 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'; |
11 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; | 11 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; |
12 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 12 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
13 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; | 13 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; |
14 import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin; | 14 import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin; |
15 import 'package:plugin/manager.dart'; | |
16 import 'package:test/test.dart'; | 15 import 'package:test/test.dart'; |
17 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 16 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
18 | 17 |
19 import '../analysis_abstract.dart'; | 18 import '../analysis_abstract.dart'; |
20 | 19 |
21 main() { | 20 main() { |
22 defineReflectiveSuite(() { | 21 defineReflectiveSuite(() { |
23 defineReflectiveTests(AssistsTest); | 22 defineReflectiveTests(AssistsTest); |
24 }); | 23 }); |
25 } | 24 } |
(...skipping 12 matching lines...) Expand all Loading... |
38 new EditGetAssistsParams(testFile, offset, length).toRequest('0'); | 37 new EditGetAssistsParams(testFile, offset, length).toRequest('0'); |
39 Response response = await waitResponse(request); | 38 Response response = await waitResponse(request); |
40 var result = new EditGetAssistsResult.fromResponse(response); | 39 var result = new EditGetAssistsResult.fromResponse(response); |
41 changes = result.assists; | 40 changes = result.assists; |
42 } | 41 } |
43 | 42 |
44 @override | 43 @override |
45 void setUp() { | 44 void setUp() { |
46 super.setUp(); | 45 super.setUp(); |
47 createProject(); | 46 createProject(); |
48 ExtensionManager manager = new ExtensionManager(); | |
49 manager.processPlugins([server.serverPlugin]); | |
50 handler = new EditDomainHandler(server); | 47 handler = new EditDomainHandler(server); |
51 } | 48 } |
52 | 49 |
53 test_fromPlugins() async { | 50 test_fromPlugins() async { |
54 PluginInfo info = new DiscoveredPluginInfo('a', 'b', 'c', null, null); | 51 PluginInfo info = new DiscoveredPluginInfo('a', 'b', 'c', null, null); |
55 String message = 'From a plugin'; | 52 String message = 'From a plugin'; |
56 plugin.PrioritizedSourceChange change = new plugin.PrioritizedSourceChange( | 53 plugin.PrioritizedSourceChange change = new plugin.PrioritizedSourceChange( |
57 5, | 54 5, |
58 new SourceChange(message, edits: <SourceFileEdit>[ | 55 new SourceChange(message, edits: <SourceFileEdit>[ |
59 new SourceFileEdit('', 0, | 56 new SourceFileEdit('', 0, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 if (change.message == message) { | 125 if (change.message == message) { |
129 String resultCode = | 126 String resultCode = |
130 SourceEdit.applySequence(testCode, change.edits[0].edits); | 127 SourceEdit.applySequence(testCode, change.edits[0].edits); |
131 expect(resultCode, expectedCode); | 128 expect(resultCode, expectedCode); |
132 return; | 129 return; |
133 } | 130 } |
134 } | 131 } |
135 fail("Expected to find |$message| in\n" + changes.join('\n')); | 132 fail("Expected to find |$message| in\n" + changes.join('\n')); |
136 } | 133 } |
137 } | 134 } |
OLD | NEW |