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

Unified Diff: pkg/analyzer/test/src/dart/analysis/driver_test.dart

Issue 2989633002: Issue 30238. Fix for subscribing for a notifications with already cached analysis result. (Closed)
Patch Set: Created 3 years, 5 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/analyzer/test/src/dart/analysis/driver_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index cf941a4fbce43bdb788f72332b227dcea3acbd86..c3e6cde79e5e5c0b2aea693d223fb7cf73da37f4 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -562,8 +562,25 @@ part 'part.dart';
AnalysisResult result1 = await driver.getResult(a);
expect(driver.test.priorityResults, containsPair(a, result1));
- AnalysisResult result2 = await driver.getResult(a);
- expect(result2, same(result1));
+ await scheduler.waitForIdle();
+ allResults.clear();
+
+ // Get the (cached) result, not reported to the stream.
+ {
+ AnalysisResult result2 = await driver.getResult(a);
+ expect(result2, same(result1));
+ expect(allResults, isEmpty);
+ }
+
+ // Get the (cached) result, reported to the stream.
+ {
+ AnalysisResult result2 =
+ await driver.getResult(a, sendCachedToStream: true);
+ expect(result2, same(result1));
+
+ expect(allResults, hasLength(1));
+ expect(allResults.single, same(result1));
+ }
}
test_cachedPriorityResults_flush_onAnyFileChange() async {
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/driver.dart ('k') | pkg/analyzer/test/src/dart/analysis/session_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698