| 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/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 Future test_serverStatusNotifications() { | 421 Future test_serverStatusNotifications() { |
| 422 MockAnalysisContext context = new MockAnalysisContext('context'); | 422 MockAnalysisContext context = new MockAnalysisContext('context'); |
| 423 MockSource source = new MockSource('source'); | 423 MockSource source = new MockSource('source'); |
| 424 when(source.fullName).thenReturn('foo.dart'); | 424 when(source.fullName).thenReturn('foo.dart'); |
| 425 when(source.isInSystemLibrary).thenReturn(false); | 425 when(source.isInSystemLibrary).thenReturn(false); |
| 426 ChangeNoticeImpl notice = new ChangeNoticeImpl(source); | 426 ChangeNoticeImpl notice = new ChangeNoticeImpl(source); |
| 427 notice.setErrors([], new LineInfo([0])); | 427 notice.setErrors([], new LineInfo([0])); |
| 428 AnalysisResult firstResult = new AnalysisResult([notice], 0, '', 0); | 428 AnalysisResult firstResult = new AnalysisResult([notice], 0, '', 0); |
| 429 AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1); | 429 AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1); |
| 430 when(context.analysisOptions).thenReturn(new AnalysisOptionsImpl()); | 430 when(context.analysisOptions).thenReturn(new AnalysisOptionsImpl()); |
| 431 when(context.validateCacheConsistency()).thenReturn(false); |
| 431 when(context.performAnalysisTask) | 432 when(context.performAnalysisTask) |
| 432 .thenReturnList([firstResult, firstResult, firstResult, lastResult]); | 433 .thenReturnList([firstResult, firstResult, firstResult, lastResult]); |
| 433 server.serverServices.add(ServerService.STATUS); | 434 server.serverServices.add(ServerService.STATUS); |
| 434 server.schedulePerformAnalysisOperation(context); | 435 server.schedulePerformAnalysisOperation(context); |
| 435 // Pump the event queue to make sure the server has finished any | 436 // Pump the event queue to make sure the server has finished any |
| 436 // analysis. | 437 // analysis. |
| 437 return pumpEventQueue().then((_) { | 438 return pumpEventQueue().then((_) { |
| 438 List<Notification> notifications = channel.notificationsReceived; | 439 List<Notification> notifications = channel.notificationsReceived; |
| 439 expect(notifications, isNotEmpty); | 440 expect(notifications, isNotEmpty); |
| 440 // expect at least one notification indicating analysis is in progress | 441 // expect at least one notification indicating analysis is in progress |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 _MockServerOperation(this.context); | 501 _MockServerOperation(this.context); |
| 501 | 502 |
| 502 @override | 503 @override |
| 503 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; | 504 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; |
| 504 | 505 |
| 505 @override | 506 @override |
| 506 void perform(AnalysisServer server) { | 507 void perform(AnalysisServer server) { |
| 507 isComplete = true; | 508 isComplete = true; |
| 508 } | 509 } |
| 509 } | 510 } |
| OLD | NEW |