| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 Future test_serverStatusNotifications() { | 278 Future test_serverStatusNotifications() { |
| 279 MockAnalysisContext context = new MockAnalysisContext('context'); | 279 MockAnalysisContext context = new MockAnalysisContext('context'); |
| 280 MockSource source = new MockSource('source'); | 280 MockSource source = new MockSource('source'); |
| 281 when(source.fullName).thenReturn('foo.dart'); | 281 when(source.fullName).thenReturn('foo.dart'); |
| 282 when(source.isInSystemLibrary).thenReturn(false); | 282 when(source.isInSystemLibrary).thenReturn(false); |
| 283 ChangeNoticeImpl notice = new ChangeNoticeImpl(source); | 283 ChangeNoticeImpl notice = new ChangeNoticeImpl(source); |
| 284 notice.setErrors([], new LineInfo([0])); | 284 notice.setErrors([], new LineInfo([0])); |
| 285 AnalysisResult firstResult = new AnalysisResult([notice], 0, '', 0); | 285 AnalysisResult firstResult = new AnalysisResult([notice], 0, '', 0); |
| 286 AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1); | 286 AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1); |
| 287 when(context.analysisOptions).thenReturn(new AnalysisOptionsImpl()); |
| 287 when( | 288 when( |
| 288 context.performAnalysisTask).thenReturnList( | 289 context.performAnalysisTask).thenReturnList( |
| 289 [firstResult, firstResult, firstResult, lastResult]); | 290 [firstResult, firstResult, firstResult, lastResult]); |
| 290 server.serverServices.add(ServerService.STATUS); | 291 server.serverServices.add(ServerService.STATUS); |
| 291 server.schedulePerformAnalysisOperation(context); | 292 server.schedulePerformAnalysisOperation(context); |
| 292 // Pump the event queue to make sure the server has finished any | 293 // Pump the event queue to make sure the server has finished any |
| 293 // analysis. | 294 // analysis. |
| 294 return pumpEventQueue().then((_) { | 295 return pumpEventQueue().then((_) { |
| 295 List<Notification> notifications = channel.notificationsReceived; | 296 List<Notification> notifications = channel.notificationsReceived; |
| 296 expect(notifications, isNotEmpty); | 297 expect(notifications, isNotEmpty); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 @override | 333 @override |
| 333 Response handleRequest(Request request) { | 334 Response handleRequest(Request request) { |
| 334 if (request.method == 'echo') { | 335 if (request.method == 'echo') { |
| 335 return new Response(request.id, result: { | 336 return new Response(request.id, result: { |
| 336 'echo': true | 337 'echo': true |
| 337 }); | 338 }); |
| 338 } | 339 } |
| 339 return null; | 340 return null; |
| 340 } | 341 } |
| 341 } | 342 } |
| OLD | NEW |