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

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

Issue 1410493005: Tweak for make test passing with useTaskModel = true. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 verify(server.index.index(anyObject, testUnitMatcher)).times(2); 110 if (AnalysisEngine.instance.useTaskModel) {
111 verify(server.index.index(anyObject, testUnitMatcher)).times(3);
112 } else {
113 verify(server.index.index(anyObject, testUnitMatcher)).times(2);
114 }
111 } 115 }
112 116
113 test_multiple_contexts() async { 117 test_multiple_contexts() async {
114 String fooPath = '/project1/foo.dart'; 118 String fooPath = '/project1/foo.dart';
115 resourceProvider.newFile( 119 resourceProvider.newFile(
116 fooPath, 120 fooPath,
117 ''' 121 '''
118 library foo; 122 library foo;
119 import '../project2/baz.dart'; 123 import '../project2/baz.dart';
120 main() { f(); }'''); 124 main() { f(); }''');
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 270
267 @override 271 @override
268 bool matches(arg) { 272 bool matches(arg) {
269 return arg is CompilationUnit && arg.element.source.fullName == file; 273 return arg is CompilationUnit && arg.element.source.fullName == file;
270 } 274 }
271 } 275 }
272 276
273 class _MockIndex extends TypedMock implements Index { 277 class _MockIndex extends TypedMock implements Index {
274 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 278 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
275 } 279 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698