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

Unified Diff: pkg/analysis_server/test/mocks.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, 11 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/mocks.dart
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index 6f51d828385f8baa883a3de84add065c51d54b7b..c017c636075540493d636c722fc572498a980c7a 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -67,23 +67,6 @@ Future pumpEventQueue([int times = 50]) {
return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1));
}
-/**
- * Returns a [Future] that completes when the given [AnalysisServer] finished
- * all its scheduled tasks.
- */
-Future waitForServerOperationsPerformed(AnalysisServer server) {
- if (server.isAnalysisComplete()) {
- return new Future.value();
- }
- // We use a delayed future to allow microtask events to finish. The
- // Future.value or Future() constructors use scheduleMicrotask themselves and
- // would therefore not wait for microtask callbacks that are scheduled after
- // invoking this method.
- return new Future.delayed(
- Duration.ZERO,
- () => waitForServerOperationsPerformed(server));
-}
-
typedef void MockServerOperationPerformFunction(AnalysisServer server);
class MockAnalysisContext extends StringTypedMock implements AnalysisContext {

Powered by Google App Engine
This is Rietveld 408576698