| Index: pkg/analysis_server/test/analysis/update_content_test.dart
|
| diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart
|
| index b8c313d34fa07ed4a138540df0ee0ac51b3136ed..135ce6ab31509efd998ef0e7008499325c8d0e3d 100644
|
| --- a/pkg/analysis_server/test/analysis/update_content_test.dart
|
| +++ b/pkg/analysis_server/test/analysis/update_content_test.dart
|
| @@ -4,6 +4,7 @@
|
|
|
| library test.analysis.updateContent;
|
|
|
| +import 'package:analysis_server/src/analysis_server.dart';
|
| import 'package:analysis_server/src/constants.dart';
|
| import 'package:analysis_server/src/protocol.dart';
|
| import 'package:analysis_server/src/services/index/index.dart';
|
| @@ -177,6 +178,24 @@ f() {}
|
| expect(_getUserSources(context2), isEmpty);
|
| }
|
|
|
| + test_removeOverlay_incrementalChange() async {
|
| + createProject();
|
| + addTestFile('main() { print(1); }');
|
| + await server.onAnalysisComplete;
|
| + CompilationUnit unit = _getTestUnit();
|
| + // add an overlay
|
| + server.updateContent(
|
| + '1', {testFile: new AddContentOverlay('main() { print(2); }')});
|
| + // it was an incremental change
|
| + await server.onAnalysisComplete;
|
| + expect(_getTestUnit(), same(unit));
|
| + // remove overlay
|
| + server.updateContent('2', {testFile: new RemoveContentOverlay()});
|
| + // it was an incremental change
|
| + await server.onAnalysisComplete;
|
| + expect(_getTestUnit(), same(unit));
|
| + }
|
| +
|
| test_sendNoticesAfterNopChange() async {
|
| createProject();
|
| addTestFile('');
|
| @@ -214,6 +233,13 @@ f() {}
|
| expect(filesErrors, isNotEmpty);
|
| }
|
|
|
| + CompilationUnit _getTestUnit() {
|
| + ContextSourcePair pair = server.getContextSourcePair(testFile);
|
| + AnalysisContext context = pair.context;
|
| + Source source = pair.source;
|
| + return context.getResolvedCompilationUnit2(source, source);
|
| + }
|
| +
|
| List<Source> _getUserSources(AnalysisContext context) {
|
| List<Source> sources = <Source>[];
|
| context.sources.forEach((source) {
|
|
|