| Index: pkg/analyzer/test/src/context/context_test.dart
|
| diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
|
| index d7e0a589a8332abb27ec4495d480e703e2f97f9f..cf4db30c93642040281eeee8fbe4f669fd8137df 100644
|
| --- a/pkg/analyzer/test/src/context/context_test.dart
|
| +++ b/pkg/analyzer/test/src/context/context_test.dart
|
| @@ -1463,6 +1463,44 @@ main() {}''');
|
| expect(context.isServerLibrary(source), isFalse);
|
| }
|
|
|
| + void test_onResultInvalidated_removeSource() {
|
| + Source source = addSource('/test.dart', 'main() {}');
|
| + bool listenerInvoked = false;
|
| + context
|
| + .onResultInvalidated(RESOLVED_UNIT)
|
| + .listen((InvalidatedResult event) {
|
| + Source eventSource = event.entry.target.source;
|
| + expect(event.descriptor, RESOLVED_UNIT);
|
| + expect(eventSource, source);
|
| + listenerInvoked = true;
|
| + });
|
| + _analyzeAll_assertFinished();
|
| + // apply changes
|
| + expect(listenerInvoked, false);
|
| + context.applyChanges(new ChangeSet()..removedSource(source));
|
| + // verify
|
| + expect(listenerInvoked, isTrue);
|
| + }
|
| +
|
| + void test_onResultInvalidated_setContents() {
|
| + Source source = addSource('/test.dart', 'main() {}');
|
| + bool listenerInvoked = false;
|
| + context
|
| + .onResultInvalidated(RESOLVED_UNIT)
|
| + .listen((InvalidatedResult event) {
|
| + Source eventSource = event.entry.target.source;
|
| + expect(event.descriptor, RESOLVED_UNIT);
|
| + expect(eventSource, source);
|
| + listenerInvoked = true;
|
| + });
|
| + _analyzeAll_assertFinished();
|
| + // apply changes
|
| + expect(listenerInvoked, false);
|
| + context.setContents(source, 'class B {}');
|
| + // verify
|
| + expect(listenerInvoked, isTrue);
|
| + }
|
| +
|
| void test_parseCompilationUnit_errors() {
|
| Source source = addSource("/lib.dart", "library {");
|
| CompilationUnit compilationUnit = context.parseCompilationUnit(source);
|
|
|