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

Side by Side Diff: pkg/analysis_server/test/analysis/update_content_test.dart

Issue 1490233007: Remove the old task model (Closed) Base URL: https://github.com/dart-lang/sdk.git@analyzer-breaking-0.27
Patch Set: Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.analysis.updateContent; 5 library test.analysis.updateContent;
6 6
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; 7 import 'package:analysis_server/plugin/protocol/protocol.dart';
8 import 'package:analysis_server/src/analysis_server.dart'; 8 import 'package:analysis_server/src/analysis_server.dart';
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/services/index/index.dart'; 10 import 'package:analysis_server/src/services/index/index.dart';
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 server.updateContent( 100 server.updateContent(
101 '1', {testFile: new AddContentOverlay('main() { print(2); }')}); 101 '1', {testFile: new AddContentOverlay('main() { print(2); }')});
102 // Perform the next single operation: analysis. 102 // Perform the next single operation: analysis.
103 // It will schedule an indexing operation. 103 // It will schedule an indexing operation.
104 await server.test_onOperationPerformed; 104 await server.test_onOperationPerformed;
105 // Update the file and remove an overlay. 105 // Update the file and remove an overlay.
106 resourceProvider.updateFile(testFile, 'main() { print(2); }'); 106 resourceProvider.updateFile(testFile, 'main() { print(2); }');
107 server.updateContent('2', {testFile: new RemoveContentOverlay()}); 107 server.updateContent('2', {testFile: new RemoveContentOverlay()});
108 // Validate that at the end the unit was indexed. 108 // Validate that at the end the unit was indexed.
109 await server.onAnalysisComplete; 109 await server.onAnalysisComplete;
110 if (AnalysisEngine.instance.useTaskModel) { 110 verify(server.index.index(anyObject, testUnitMatcher)).times(3);
111 verify(server.index.index(anyObject, testUnitMatcher)).times(3);
112 } else {
113 verify(server.index.index(anyObject, testUnitMatcher)).times(2);
114 }
115 } 111 }
116 112
117 test_multiple_contexts() async { 113 test_multiple_contexts() async {
118 String fooPath = '/project1/foo.dart'; 114 String fooPath = '/project1/foo.dart';
119 resourceProvider.newFile( 115 resourceProvider.newFile(
120 fooPath, 116 fooPath,
121 ''' 117 '''
122 library foo; 118 library foo;
123 import '../project2/baz.dart'; 119 import '../project2/baz.dart';
124 main() { f(); }'''); 120 main() { f(); }''');
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 266
271 @override 267 @override
272 bool matches(arg) { 268 bool matches(arg) {
273 return arg is CompilationUnit && arg.element.source.fullName == file; 269 return arg is CompilationUnit && arg.element.source.fullName == file;
274 } 270 }
275 } 271 }
276 272
277 class _MockIndex extends TypedMock implements Index { 273 class _MockIndex extends TypedMock implements Index {
278 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 274 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
279 } 275 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/analysis/notification_errors_test.dart ('k') | pkg/analysis_server/test/domain_completion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698