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

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

Issue 508203002: Rename some bools in the analysis server API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
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:analyzer/file_system/physical_file_system.dart'; 7 import 'package:analyzer/file_system/physical_file_system.dart';
8 import 'package:analysis_server/src/analysis_server.dart'; 8 import 'package:analysis_server/src/analysis_server.dart';
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/domain_server.dart'; 10 import 'package:analysis_server/src/domain_server.dart';
(...skipping 27 matching lines...) Expand all
38 helper.server.schedulePerformAnalysisOperation(context); 38 helper.server.schedulePerformAnalysisOperation(context);
39 // Pump the event queue to make sure the server has finished any 39 // Pump the event queue to make sure the server has finished any
40 // analysis. 40 // analysis.
41 return pumpEventQueue().then((_) { 41 return pumpEventQueue().then((_) {
42 List<Notification> notifications = helper.channel.notificationsReceived; 42 List<Notification> notifications = helper.channel.notificationsReceived;
43 expect(notifications, isNot(isEmpty)); 43 expect(notifications, isNot(isEmpty));
44 // expect at least one notification indicating analysis is in progress 44 // expect at least one notification indicating analysis is in progress
45 expect(notifications.any((Notification notification) { 45 expect(notifications.any((Notification notification) {
46 if (notification.event == SERVER_STATUS) { 46 if (notification.event == SERVER_STATUS) {
47 var params = new ServerStatusParams.fromNotification(notification); 47 var params = new ServerStatusParams.fromNotification(notification);
48 return params.analysis.analyzing; 48 return params.analysis.isAnalyzing;
49 } 49 }
50 return false; 50 return false;
51 }), isTrue); 51 }), isTrue);
52 // the last notification should indicate that analysis is complete 52 // the last notification should indicate that analysis is complete
53 Notification notification = notifications[notifications.length - 1]; 53 Notification notification = notifications[notifications.length - 1];
54 var params = new ServerStatusParams.fromNotification(notification); 54 var params = new ServerStatusParams.fromNotification(notification);
55 expect(params.analysis.analyzing, isFalse); 55 expect(params.analysis.isAnalyzing, isFalse);
56 }); 56 });
57 }); 57 });
58 58
59 test('echo', () { 59 test('echo', () {
60 AnalysisServerTestHelper helper = new AnalysisServerTestHelper(); 60 AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
61 helper.server.handlers = [new EchoHandler()]; 61 helper.server.handlers = [new EchoHandler()];
62 var request = new Request('my22', 'echo'); 62 var request = new Request('my22', 'echo');
63 return helper.channel.sendRequest(request) 63 return helper.channel.sendRequest(request)
64 .then((Response response) { 64 .then((Response response) {
65 expect(response.id, equals('my22')); 65 expect(response.id, equals('my22'));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 class EchoHandler implements RequestHandler { 120 class EchoHandler implements RequestHandler {
121 @override 121 @override
122 Response handleRequest(Request request) { 122 Response handleRequest(Request request) {
123 if (request.method == 'echo') { 123 if (request.method == 'echo') {
124 return new Response(request.id, result: {'echo': true}); 124 return new Response(request.id, result: {'echo': true});
125 } 125 }
126 return null; 126 return null;
127 } 127 }
128 } 128 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/generated_protocol.dart ('k') | pkg/analysis_server/test/domain_completion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698