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

Side by Side Diff: pkg/analyzer_plugin/test/plugin/plugin_test.dart

Issue 2988743002: Remove the analysus.reanalyze request from the plugin API (Closed)
Patch Set: Restart plugins Created 3 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 'package:analyzer/file_system/file_system.dart'; 5 import 'package:analyzer/file_system/file_system.dart';
6 import 'package:analyzer/file_system/memory_file_system.dart'; 6 import 'package:analyzer/file_system/memory_file_system.dart';
7 import 'package:analyzer/src/dart/analysis/driver.dart'; 7 import 'package:analyzer/src/dart/analysis/driver.dart';
8 import 'package:analyzer_plugin/protocol/protocol.dart'; 8 import 'package:analyzer_plugin/protocol/protocol.dart';
9 import 'package:analyzer_plugin/protocol/protocol_common.dart'; 9 import 'package:analyzer_plugin/protocol/protocol_common.dart';
10 import 'package:analyzer_plugin/protocol/protocol_generated.dart'; 10 import 'package:analyzer_plugin/protocol/protocol_generated.dart';
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 .handleAnalysisGetNavigation(new AnalysisGetNavigationParams('', 1, 2)); 74 .handleAnalysisGetNavigation(new AnalysisGetNavigationParams('', 1, 2));
75 expect(result, isNotNull); 75 expect(result, isNotNull);
76 } 76 }
77 77
78 test_handleAnalysisHandleWatchEvents() async { 78 test_handleAnalysisHandleWatchEvents() async {
79 var result = await plugin.handleAnalysisHandleWatchEvents( 79 var result = await plugin.handleAnalysisHandleWatchEvents(
80 new AnalysisHandleWatchEventsParams([])); 80 new AnalysisHandleWatchEventsParams([]));
81 expect(result, isNotNull); 81 expect(result, isNotNull);
82 } 82 }
83 83
84 test_handleAnalysisReanalyze_all() async {
85 await plugin.handleAnalysisSetContextRoots(
86 new AnalysisSetContextRootsParams([contextRoot1]));
87 var result =
88 await plugin.handleAnalysisReanalyze(new AnalysisReanalyzeParams());
89 expect(result, isNotNull);
90 }
91
92 @failingTest
93 test_handleAnalysisReanalyze_subset() async {
94 await plugin.handleAnalysisSetContextRoots(
95 new AnalysisSetContextRootsParams([contextRoot1]));
96 await plugin.handleAnalysisSetContextRoots(
97 new AnalysisSetContextRootsParams([contextRoot2]));
98 var result = await plugin.handleAnalysisReanalyze(
99 new AnalysisReanalyzeParams(roots: [packagePath2]));
100 expect(result, isNotNull);
101 }
102
103 test_handleAnalysisSetContextRoots() async { 84 test_handleAnalysisSetContextRoots() async {
104 var result = await plugin.handleAnalysisSetContextRoots( 85 var result = await plugin.handleAnalysisSetContextRoots(
105 new AnalysisSetContextRootsParams([contextRoot1])); 86 new AnalysisSetContextRootsParams([contextRoot1]));
106 expect(result, isNotNull); 87 expect(result, isNotNull);
107 AnalysisDriverGeneric driver = _getDriver(contextRoot1); 88 AnalysisDriverGeneric driver = _getDriver(contextRoot1);
108 expect(driver, isNotNull); 89 expect(driver, isNotNull);
109 expect((driver as MockAnalysisDriver).addedFiles, hasLength(1)); 90 expect((driver as MockAnalysisDriver).addedFiles, hasLength(1));
110 } 91 }
111 92
112 test_handleAnalysisSetPriorityFiles() async { 93 test_handleAnalysisSetPriorityFiles() async {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 await channel.sendRequest(new AnalysisGetNavigationParams('', 1, 2)); 244 await channel.sendRequest(new AnalysisGetNavigationParams('', 1, 2));
264 expect(result, isNotNull); 245 expect(result, isNotNull);
265 } 246 }
266 247
267 test_onRequest_analysisHandleWatchEvents() async { 248 test_onRequest_analysisHandleWatchEvents() async {
268 var result = 249 var result =
269 await channel.sendRequest(new AnalysisHandleWatchEventsParams([])); 250 await channel.sendRequest(new AnalysisHandleWatchEventsParams([]));
270 expect(result, isNotNull); 251 expect(result, isNotNull);
271 } 252 }
272 253
273 test_onRequest_analysisReanalyze_all() async {
274 await channel
275 .sendRequest(new AnalysisSetContextRootsParams([contextRoot1]));
276 var result = await channel.sendRequest(new AnalysisReanalyzeParams());
277 expect(result, isNotNull);
278 }
279
280 test_onRequest_analysisReanalyze_subset() async {
281 await channel
282 .sendRequest(new AnalysisSetContextRootsParams([contextRoot1]));
283 await channel
284 .sendRequest(new AnalysisSetContextRootsParams([contextRoot2]));
285 var result = await channel
286 .sendRequest(new AnalysisReanalyzeParams(roots: [packagePath2]));
287 expect(result, isNotNull);
288 }
289
290 test_onRequest_analysisSetContextRoots() async { 254 test_onRequest_analysisSetContextRoots() async {
291 var result = await channel 255 var result = await channel
292 .sendRequest(new AnalysisSetContextRootsParams([contextRoot1])); 256 .sendRequest(new AnalysisSetContextRootsParams([contextRoot1]));
293 expect(result, isNotNull); 257 expect(result, isNotNull);
294 AnalysisDriverGeneric driver = _getDriver(contextRoot1); 258 AnalysisDriverGeneric driver = _getDriver(contextRoot1);
295 expect(driver, isNotNull); 259 expect(driver, isNotNull);
296 expect((driver as MockAnalysisDriver).addedFiles, hasLength(1)); 260 expect((driver as MockAnalysisDriver).addedFiles, hasLength(1));
297 } 261 }
298 262
299 test_onRequest_analysisSetPriorityFiles() async { 263 test_onRequest_analysisSetPriorityFiles() async {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 377
414 _TestServerPlugin(ResourceProvider resourceProvider) 378 _TestServerPlugin(ResourceProvider resourceProvider)
415 : super(resourceProvider); 379 : super(resourceProvider);
416 380
417 @override 381 @override
418 void sendNotificationsForSubscriptions( 382 void sendNotificationsForSubscriptions(
419 Map<String, List<AnalysisService>> subscriptions) { 383 Map<String, List<AnalysisService>> subscriptions) {
420 latestSubscriptions = subscriptions; 384 latestSubscriptions = subscriptions;
421 } 385 }
422 } 386 }
OLDNEW
« no previous file with comments | « pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart ('k') | pkg/analyzer_plugin/tool/spec/plugin_spec.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698