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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 Future test_serverStatusNotifications() { | 440 Future test_serverStatusNotifications() { |
441 MockAnalysisContext context = new MockAnalysisContext('context'); | 441 MockAnalysisContext context = new MockAnalysisContext('context'); |
442 MockSource source = new MockSource('source'); | 442 MockSource source = new MockSource('source'); |
443 when(source.fullName).thenReturn('foo.dart'); | 443 when(source.fullName).thenReturn('foo.dart'); |
444 when(source.isInSystemLibrary).thenReturn(false); | 444 when(source.isInSystemLibrary).thenReturn(false); |
445 ChangeNoticeImpl notice = new ChangeNoticeImpl(source); | 445 ChangeNoticeImpl notice = new ChangeNoticeImpl(source); |
446 notice.setErrors([], new LineInfo([0])); | 446 notice.setErrors([], new LineInfo([0])); |
447 AnalysisResult firstResult = new AnalysisResult([notice], 0, '', 0); | 447 AnalysisResult firstResult = new AnalysisResult([notice], 0, '', 0); |
448 AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1); | 448 AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1); |
449 when(context.analysisOptions).thenReturn(new AnalysisOptionsImpl()); | 449 when(context.analysisOptions).thenReturn(new AnalysisOptionsImpl()); |
450 when(context.validateCacheConsistency()).thenReturn(false); | |
451 when(context.performAnalysisTask) | 450 when(context.performAnalysisTask) |
452 .thenReturnList([firstResult, firstResult, firstResult, lastResult]); | 451 .thenReturnList([firstResult, firstResult, firstResult, lastResult]); |
453 server.serverServices.add(ServerService.STATUS); | 452 server.serverServices.add(ServerService.STATUS); |
454 server.schedulePerformAnalysisOperation(context); | 453 server.schedulePerformAnalysisOperation(context); |
455 // Pump the event queue to make sure the server has finished any | 454 // Pump the event queue to make sure the server has finished any |
456 // analysis. | 455 // analysis. |
457 return pumpEventQueue().then((_) { | 456 return pumpEventQueue().then((_) { |
458 List<Notification> notifications = channel.notificationsReceived; | 457 List<Notification> notifications = channel.notificationsReceived; |
459 expect(notifications, isNotEmpty); | 458 expect(notifications, isNotEmpty); |
460 // expect at least one notification indicating analysis is in progress | 459 // expect at least one notification indicating analysis is in progress |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 _MockServerOperation(this.context); | 593 _MockServerOperation(this.context); |
595 | 594 |
596 @override | 595 @override |
597 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; | 596 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; |
598 | 597 |
599 @override | 598 @override |
600 void perform(AnalysisServer server) { | 599 void perform(AnalysisServer server) { |
601 isComplete = true; | 600 isComplete = true; |
602 } | 601 } |
603 } | 602 } |
OLD | NEW |