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

Unified Diff: pkg/analysis_server/test/analysis_server_test.dart

Issue 308003009: Add ServerOperation and queue. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes for review comments Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/analysis_server_test.dart
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index 98e560166c174ea0418d7c72abad68d683ab33a3..9ed551cc47447a8a61ff887f975352dddd05ae4a 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -4,8 +4,6 @@
library test.analysis_server;
-import 'dart:async';
-
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/source.dart';
@@ -34,16 +32,6 @@ class AnalysisServerTestHelper {
main() {
group('AnalysisServer', () {
- test('addContextToWorkQueue_whenNotRunning', () {
- AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
- helper.server.running = false;
- MockAnalysisContext context = new MockAnalysisContext();
- helper.server.addContextToWorkQueue(context);
- // Pump the event queue to make sure the server doesn't try to do any
- // analysis.
- return pumpEventQueue();
- });
-
test('server.status notifications', () {
AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
MockAnalysisContext context = new MockAnalysisContext();
@@ -57,12 +45,12 @@ main() {
context.when(callsTo("performAnalysisTask"))
..thenReturn(firstResult, 3)
..thenReturn(lastResult);
- helper.server.addContextToWorkQueue(context);
+ helper.server.schedulePerformAnalysisOperation(context);
// Pump the event queue to make sure the server has finished any
// analysis.
return pumpEventQueue().then((_) {
List<Notification> notifications = helper.channel.notificationsReceived;
- expect(notifications.length, equals(9));
+ expect(notifications.length, equals(5));
Brian Wilkerson 2014/06/02 18:21:03 Given that the length will change every time we ad
scheglov 2014/06/02 18:32:26 Done.
Notification notification = notifications[notifications.length - 1];
Map analysisStatus = notification.params['analysis'];
expect(analysisStatus['analyzing'], isFalse);
@@ -123,19 +111,6 @@ main() {
expect(json['correction'], equals(errorCode.correction));
});
- test('performTask_whenNotRunning', () {
- AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
- // If the server is shut down while there is analysis still pending,
- // performTask() should notice that the server is no longer running and
- // do no analysis.
- MockAnalysisContext context = new MockAnalysisContext();
- helper.server.addContextToWorkQueue(context);
- helper.server.running = false;
- // Pump the event queue to make sure the server doesn't try to do any
- // analysis.
- return pumpEventQueue();
- });
-
test('shutdown', () {
AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
helper.server.handlers = [new ServerDomainHandler(helper.server)];

Powered by Google App Engine
This is Rietveld 408576698