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

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

Issue 757613002: new onPriorityChanged event stream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix test Created 6 years, 1 month 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 8d06fe7c93ac52e79a1fef6cae6806014d849c3d..5f7f21efe10af2cfbf0644155d4630c4ad987459 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -154,6 +154,41 @@ main() {
expect(wasRemoved, isTrue);
});
});
+
+ test('priority sources changed event', () {
+ AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
+ helper.resourceProvider.newFolder('/foo');
+
+ int eventCount = 0;
+ Source firstSource = null;
+ helper.server.onPriorityChange.listen((PriorityChangeEvent event) {
+ ++eventCount;
+ firstSource = event.firstSource;
+ });
+
+ helper.server.setAnalysisRoots('0', ['/foo'], [], {});
+ return pumpEventQueue().then((_) {
+ expect(eventCount, 0);
+
+ helper.server.setPriorityFiles('1', ['/foo/bar.dart']);
+ return pumpEventQueue();
+ }).then((_) {
+ expect(eventCount, 1);
+ expect(firstSource.fullName, '/foo/bar.dart');
+
+ helper.server.setPriorityFiles('2', ['/foo/b1.dart', '/foo/b2.dart']);
+ return pumpEventQueue();
+ }).then((_) {
+ expect(eventCount, 2);
+ expect(firstSource.fullName, '/foo/b1.dart');
+
+ helper.server.setPriorityFiles('17', []);
+ return pumpEventQueue();
+ }).then((_) {
+ expect(eventCount, 3);
+ expect(firstSource, isNull);
+ });
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698