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

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

Issue 790363006: Upgrade unittest to be able to use isNotEmpty. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | « pkg/analysis_server/pubspec.yaml ('k') | pkg/analysis_server/test/domain_analysis_test.dart » ('j') | 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 'package:analysis_server/src/analysis_server.dart'; 7 import 'package:analysis_server/src/analysis_server.dart';
8 import 'package:analysis_server/src/constants.dart'; 8 import 'package:analysis_server/src/constants.dart';
9 import 'package:analysis_server/src/domain_server.dart'; 9 import 'package:analysis_server/src/domain_server.dart';
10 import 'package:analysis_server/src/operation/operation.dart'; 10 import 'package:analysis_server/src/operation/operation.dart';
(...skipping 23 matching lines...) Expand all
34 AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1); 34 AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1);
35 when( 35 when(
36 context.performAnalysisTask).thenReturnList( 36 context.performAnalysisTask).thenReturnList(
37 [firstResult, firstResult, firstResult, lastResult]); 37 [firstResult, firstResult, firstResult, lastResult]);
38 helper.server.serverServices.add(ServerService.STATUS); 38 helper.server.serverServices.add(ServerService.STATUS);
39 helper.server.schedulePerformAnalysisOperation(context); 39 helper.server.schedulePerformAnalysisOperation(context);
40 // Pump the event queue to make sure the server has finished any 40 // Pump the event queue to make sure the server has finished any
41 // analysis. 41 // analysis.
42 return pumpEventQueue().then((_) { 42 return pumpEventQueue().then((_) {
43 List<Notification> notifications = helper.channel.notificationsReceived; 43 List<Notification> notifications = helper.channel.notificationsReceived;
44 expect(notifications, isNot(isEmpty)); 44 expect(notifications, isNotEmpty);
45 // expect at least one notification indicating analysis is in progress 45 // expect at least one notification indicating analysis is in progress
46 expect(notifications.any((Notification notification) { 46 expect(notifications.any((Notification notification) {
47 if (notification.event == SERVER_STATUS) { 47 if (notification.event == SERVER_STATUS) {
48 var params = new ServerStatusParams.fromNotification(notification); 48 var params = new ServerStatusParams.fromNotification(notification);
49 return params.analysis.isAnalyzing; 49 return params.analysis.isAnalyzing;
50 } 50 }
51 return false; 51 return false;
52 }), isTrue); 52 }), isTrue);
53 // the last notification should indicate that analysis is complete 53 // the last notification should indicate that analysis is complete
54 Notification notification = notifications[notifications.length - 1]; 54 Notification notification = notifications[notifications.length - 1];
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 @override 217 @override
218 Response handleRequest(Request request) { 218 Response handleRequest(Request request) {
219 if (request.method == 'echo') { 219 if (request.method == 'echo') {
220 return new Response(request.id, result: { 220 return new Response(request.id, result: {
221 'echo': true 221 'echo': true
222 }); 222 });
223 } 223 }
224 return null; 224 return null;
225 } 225 }
226 } 226 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/pubspec.yaml ('k') | pkg/analysis_server/test/domain_analysis_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698