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 library test.analysis_server; | 5 library test.analysis_server; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 resourceProvider.newFolder('/bar'); | 316 resourceProvider.newFolder('/bar'); |
317 resourceProvider.newFile('/foo/foo.dart', 'import "../bar/bar.dart";'); | 317 resourceProvider.newFile('/foo/foo.dart', 'import "../bar/bar.dart";'); |
318 File bar = resourceProvider.newFile('/bar/bar.dart', 'library bar;'); | 318 File bar = resourceProvider.newFile('/bar/bar.dart', 'library bar;'); |
319 server.setAnalysisRoots('0', ['/foo', '/bar'], [], {}); | 319 server.setAnalysisRoots('0', ['/foo', '/bar'], [], {}); |
320 Map<AnalysisService, Set<String>> subscriptions = | 320 Map<AnalysisService, Set<String>> subscriptions = |
321 <AnalysisService, Set<String>>{}; | 321 <AnalysisService, Set<String>>{}; |
322 for (AnalysisService service in AnalysisService.VALUES) { | 322 for (AnalysisService service in AnalysisService.VALUES) { |
323 subscriptions[service] = <String>[bar.path].toSet(); | 323 subscriptions[service] = <String>[bar.path].toSet(); |
324 } | 324 } |
325 server.setAnalysisSubscriptions(subscriptions); | 325 server.setAnalysisSubscriptions(subscriptions); |
326 await pumpEventQueue(500); | 326 await pumpEventQueue(1000); |
327 expect(server.statusAnalyzing, isFalse); | 327 expect(server.statusAnalyzing, isFalse); |
328 channel.notificationsReceived.clear(); | 328 channel.notificationsReceived.clear(); |
329 server.updateContent( | 329 server.updateContent( |
330 '0', {bar.path: new AddContentOverlay('library bar; void f() {}')}); | 330 '0', {bar.path: new AddContentOverlay('library bar; void f() {}')}); |
331 await pumpEventQueue(500); | 331 await pumpEventQueue(500); |
332 expect(server.statusAnalyzing, isFalse); | 332 expect(server.statusAnalyzing, isFalse); |
333 expect(channel.notificationsReceived, isNotEmpty); | 333 expect(channel.notificationsReceived, isNotEmpty); |
334 Set<String> notificationTypesReceived = new Set<String>(); | 334 Set<String> notificationTypesReceived = new Set<String>(); |
335 for (Notification notification in channel.notificationsReceived) { | 335 for (Notification notification in channel.notificationsReceived) { |
336 String notificationType = notification.event; | 336 String notificationType = notification.event; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 _MockServerOperation(this.context); | 556 _MockServerOperation(this.context); |
557 | 557 |
558 @override | 558 @override |
559 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; | 559 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; |
560 | 560 |
561 @override | 561 @override |
562 void perform(AnalysisServer server) { | 562 void perform(AnalysisServer server) { |
563 isComplete = true; | 563 isComplete = true; |
564 } | 564 } |
565 } | 565 } |
OLD | NEW |