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

Side by Side Diff: pkg/analysis_server/test/domain_execution_test.dart

Issue 875163002: Make AnalysisServer.onAnalysisComplete a Future and wait for it before refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use Completer instead of busy loop Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.domain.execution; 5 library test.domain.execution;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 when( 189 when(
190 context.getLibrariesReferencedFromHtml( 190 context.getLibrariesReferencedFromHtml(
191 anyObject)).thenReturn([source6, source7]); 191 anyObject)).thenReturn([source6, source7]);
192 192
193 ServerContextManager manager = new ServerContextManagerMock(); 193 ServerContextManager manager = new ServerContextManagerMock();
194 when(manager.isInAnalysisRoot(anyString)).thenReturn(true); 194 when(manager.isInAnalysisRoot(anyString)).thenReturn(true);
195 195
196 AnalysisServer server = new AnalysisServerMock(); 196 AnalysisServer server = new AnalysisServerMock();
197 when(server.getAnalysisContexts()).thenReturn([context]); 197 when(server.getAnalysisContexts()).thenReturn([context]);
198 when(server.contextDirectoryManager).thenReturn(manager); 198 when(server.contextDirectoryManager).thenReturn(manager);
199 when(server.isAnalysisComplete()).thenReturn(false);
200 199
201 StreamController controller = new StreamController.broadcast(sync: true); 200 StreamController controller = new StreamController.broadcast(sync: true);
202 when(server.onFileAnalyzed).thenReturn(controller.stream); 201 when(server.onFileAnalyzed).thenReturn(controller.stream);
203 202
204 List<String> unsentNotifications = <String>[ 203 List<String> unsentNotifications = <String>[
205 source1.fullName, 204 source1.fullName,
206 source2.fullName, 205 source2.fullName,
207 source3.fullName, 206 source3.fullName,
208 source4.fullName, 207 source4.fullName,
209 source5.fullName]; 208 source5.fullName];
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 * A [Source] that knows it's [fullName]. 270 * A [Source] that knows it's [fullName].
272 */ 271 */
273 class TestSource implements Source { 272 class TestSource implements Source {
274 String fullName; 273 String fullName;
275 274
276 TestSource(this.fullName); 275 TestSource(this.fullName);
277 276
278 @override 277 @override
279 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 278 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
280 } 279 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698