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

Unified Diff: components/policy/core/common/async_policy_provider_unittest.cc

Issue 2082333002: Remove calls to deprecated MessageLoop methods 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/policy/core/common/async_policy_provider_unittest.cc
diff --git a/components/policy/core/common/async_policy_provider_unittest.cc b/components/policy/core/common/async_policy_provider_unittest.cc
index 24d577b5772eda4577b06a640dd78e0aab2e4f10..aaf5e9c24d899e8616f30d1f9bafca819671ac2d 100644
--- a/components/policy/core/common/async_policy_provider_unittest.cc
+++ b/components/policy/core/common/async_policy_provider_unittest.cc
@@ -9,6 +9,7 @@
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/sequenced_task_runner.h"
#include "base/values.h"
#include "components/policy/core/common/async_policy_loader.h"
@@ -111,7 +112,7 @@ void AsyncPolicyProviderTest::SetUp() {
// Verify that the initial load is done synchronously:
EXPECT_TRUE(provider_->policies().Equals(initial_bundle_));
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
Mock::VerifyAndClearExpectations(loader_);
EXPECT_CALL(*loader_, LastModificationTime())
@@ -123,7 +124,7 @@ void AsyncPolicyProviderTest::TearDown() {
provider_->Shutdown();
provider_.reset();
}
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(AsyncPolicyProviderTest, RefreshPolicies) {
@@ -135,7 +136,7 @@ TEST_F(AsyncPolicyProviderTest, RefreshPolicies) {
provider_->AddObserver(&observer);
EXPECT_CALL(observer, OnUpdatePolicy(provider_.get())).Times(1);
provider_->RefreshPolicies();
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// The refreshed policies are now provided.
EXPECT_TRUE(provider_->policies().Equals(refreshed_bundle));
provider_->RemoveObserver(&observer);
@@ -159,7 +160,7 @@ TEST_F(AsyncPolicyProviderTest, RefreshPoliciesTwice) {
Mock::VerifyAndClearExpectations(&observer);
EXPECT_CALL(observer, OnUpdatePolicy(provider_.get())).Times(1);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// The refreshed policies are now provided.
EXPECT_TRUE(provider_->policies().Equals(refreshed_bundle));
Mock::VerifyAndClearExpectations(&observer);
@@ -195,7 +196,7 @@ TEST_F(AsyncPolicyProviderTest, RefreshPoliciesDuringReload) {
Mock::VerifyAndClearExpectations(&observer);
EXPECT_CALL(observer, OnUpdatePolicy(provider_.get())).Times(1);
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// The refreshed policies are now provided, and the |reloaded_bundle| was
// dropped.
EXPECT_TRUE(provider_->policies().Equals(refreshed_bundle));
@@ -217,7 +218,7 @@ TEST_F(AsyncPolicyProviderTest, Shutdown) {
EXPECT_CALL(observer, OnUpdatePolicy(provider_.get())).Times(0);
provider_->Shutdown();
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
Mock::VerifyAndClearExpectations(&observer);
provider_->RemoveObserver(&observer);

Powered by Google App Engine
This is Rietveld 408576698