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

Unified Diff: pkg/analysis_server/test/operation/operation_queue_test.dart

Issue 1008443002: Cherry-pick r44373, r44378, and r44275. (Closed) Base URL: https://dart.googlecode.com/svn/trunk/dart
Patch Set: Created 5 years, 9 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
« no previous file with comments | « pkg/analysis_server/test/analysis_server_test.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/operation/operation_queue_test.dart
diff --git a/pkg/analysis_server/test/operation/operation_queue_test.dart b/pkg/analysis_server/test/operation/operation_queue_test.dart
index 09a8afd60033176f04f290973e42a61054fa5d3b..de5e79579afbded70dd0cd66165d73e5d4007ddb 100644
--- a/pkg/analysis_server/test/operation/operation_queue_test.dart
+++ b/pkg/analysis_server/test/operation/operation_queue_test.dart
@@ -61,6 +61,30 @@ class ServerOperationQueueTest {
expect(queue.isEmpty, true);
}
+ void test_contextRemoved() {
+ var contextA = new AnalysisContextMock();
+ var contextB = new AnalysisContextMock();
+ var opA1 = new _ServerOperationMock(contextA);
+ var opA2 = new _ServerOperationMock(contextA);
+ var opB1 = new _ServerOperationMock(contextB);
+ var opB2 = new _ServerOperationMock(contextB);
+ when(opA1.priority)
+ .thenReturn(ServerOperationPriority.ANALYSIS_NOTIFICATION);
+ when(opA2.priority)
+ .thenReturn(ServerOperationPriority.ANALYSIS_NOTIFICATION);
+ when(opB1.priority)
+ .thenReturn(ServerOperationPriority.ANALYSIS_NOTIFICATION);
+ when(opB2.priority)
+ .thenReturn(ServerOperationPriority.ANALYSIS_NOTIFICATION);
+ queue.add(opA1);
+ queue.add(opB1);
+ queue.add(opA2);
+ queue.add(opB2);
+ queue.contextRemoved(contextA);
+ expect(queue.take(), same(opB1));
+ expect(queue.take(), same(opB2));
+ }
+
void test_isEmpty_false() {
var operation = mockOperation(ServerOperationPriority.ANALYSIS);
queue.add(operation);
@@ -148,6 +172,10 @@ class ServerOperationQueueTest {
}
class _ServerOperationMock extends TypedMock implements ServerOperation {
+ final AnalysisContext context;
+
+ _ServerOperationMock([this.context]);
+
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
« no previous file with comments | « pkg/analysis_server/test/analysis_server_test.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698