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

Unified Diff: pkg/analyzer/test/src/task/dart_work_manager_test.dart

Issue 1193993003: Add AnalysisCache.onResultInvalidated, use in DartWorkManager. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/analyzer/test/src/context/cache_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_work_manager_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_work_manager_test.dart b/pkg/analyzer/test/src/task/dart_work_manager_test.dart
index fdff1c3050297c55c80143c0a4422fa44d9a265e..9119cee155709bcc731c93f34e60cdeec0d0e122 100644
--- a/pkg/analyzer/test/src/task/dart_work_manager_test.dart
+++ b/pkg/analyzer/test/src/task/dart_work_manager_test.dart
@@ -122,18 +122,6 @@ class DartWorkManagerTest {
expect_unknownSourceQueue([]);
}
- void test_applyChange_scheduleInvalidatedLibraries() {
- // libraries source1 and source3 are invalid
- entry1.setValue(SOURCE_KIND, SourceKind.LIBRARY, []);
- entry2.setValue(SOURCE_KIND, SourceKind.PART, []);
- entry3.setValue(SOURCE_KIND, SourceKind.LIBRARY, []);
- entry1.setValue(LIBRARY_ERRORS_READY, false, []);
- entry3.setValue(LIBRARY_ERRORS_READY, false, []);
- // change source2, schedule source1 and source3
- manager.applyChange([], [source2], []);
- expect_librarySourceQueue([source1, source3]);
- }
-
void test_applyChange_updatePartsLibraries_changeLibrary() {
Source part1 = new TestSource('part1.dart');
Source part2 = new TestSource('part2.dart');
@@ -485,6 +473,22 @@ class DartWorkManagerTest {
expect(entry1.getState(INCLUDED_PARTS), CacheState.VALID);
}
+ void test_onResultInvalidated_scheduleInvalidatedLibraries() {
+ // set SOURCE_KIND
+ entry1.setValue(SOURCE_KIND, SourceKind.LIBRARY, []);
+ entry2.setValue(SOURCE_KIND, SourceKind.PART, []);
+ entry3.setValue(SOURCE_KIND, SourceKind.LIBRARY, []);
+ // set LIBRARY_ERRORS_READY for source1 and source3
+ entry1.setValue(LIBRARY_ERRORS_READY, true, []);
+ entry3.setValue(LIBRARY_ERRORS_READY, true, []);
+ // invalidate LIBRARY_ERRORS_READY for source1, schedule it
+ entry1.setState(LIBRARY_ERRORS_READY, CacheState.INVALID);
+ expect_librarySourceQueue([source1]);
+ // invalidate LIBRARY_ERRORS_READY for source3, schedule it
+ entry3.setState(LIBRARY_ERRORS_READY, CacheState.INVALID);
+ expect_librarySourceQueue([source1, source3]);
+ }
+
void test_onSourceFactoryChanged() {
when(context.exists(anyObject)).thenReturn(true);
// set cache values
« no previous file with comments | « pkg/analyzer/test/src/context/cache_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698