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

Unified Diff: components/suggestions/suggestions_service_unittest.cc

Issue 2053913002: Remove MessageLoop::current()->RunUntilIdle() in components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: components/suggestions/suggestions_service_unittest.cc
diff --git a/components/suggestions/suggestions_service_unittest.cc b/components/suggestions/suggestions_service_unittest.cc
index aa627dd0481796b7309e01479ec6ec2accc66e5d..e95923c7ebff0ab34bc48526b1d4ca5fcf3ef4a3 100644
--- a/components/suggestions/suggestions_service_unittest.cc
+++ b/components/suggestions/suggestions_service_unittest.cc
@@ -13,6 +13,7 @@
#include "base/feature_list.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/run_loop.h"
#include "components/signin/core/browser/fake_profile_oauth2_token_service.h"
#include "components/suggestions/blacklist_store.h"
#include "components/suggestions/image_manager.h"
@@ -509,9 +510,9 @@ TEST_F(SuggestionsServiceTest, BlacklistURL) {
// for future execution (note how both the SuggestionsService's scheduling
// delay and the BlacklistStore's candidacy delay are zero). Then wait on
// the blacklist request, then again on the next blacklist scheduling task.
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
io_message_loop_.RunUntilIdle();
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(2, suggestions_data_callback_count_);
EXPECT_FALSE(blacklisting_failed_);
@@ -589,11 +590,11 @@ TEST_F(SuggestionsServiceTest, BlacklistURLRequestFails) {
// second request and the third scheduling. Again, note that calling
// RunUntilIdle on the MessageLoop only works when the task is not posted for
// the future.
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
io_message_loop_.RunUntilIdle();
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
io_message_loop_.RunUntilIdle();
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
CheckSuggestionsData();
}

Powered by Google App Engine
This is Rietveld 408576698