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

Side by Side Diff: pkg/analysis_server/test/analysis_server_test.dart

Issue 846383004: Fix NPE in tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698