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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java

Issue 341533005: Change contract for ChangeSet to reflect AnalysisContext behavior. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java
index f84e7f4b59ffbd118cdf28f8f7190891e4d79968..e4a0093fae1a863b07c1a9bdc1d0bb6fa81f1dfc 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java
@@ -187,6 +187,21 @@ public class AnalysisContextImplTest extends EngineTestCase {
assertNull(context.performAnalysisTask().getChangeNotices());
}
+ public void test_applyChanges_overriddenSource() throws Exception {
+ // Note: addSource adds the source to the contentCache.
+ Source source = addSource("/test.dart", "library test;");
+ context.computeErrors(source);
+ while (!context.getSourcesNeedingProcessing().isEmpty()) {
+ context.performAnalysisTask();
+ }
+ // Adding the source as a changedSource should have no effect since it is already overridden
+ // in the content cache.
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.changedSource(source);
+ context.applyChanges(changeSet);
+ assertSizeOfList(0, context.getSourcesNeedingProcessing());
+ }
+
public void test_applyChanges_remove() throws Exception {
context = AnalysisContextFactory.contextWithCore();
sourceFactory = context.getSourceFactory();

Powered by Google App Engine
This is Rietveld 408576698