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

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

Issue 2354333002: Remove calls to MessageLoop(ForUI|ForIO)::Run/RunUntilIdle. (Closed)
Patch Set: fix build error Created 4 years, 3 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
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/policy_loader_mac_unittest.cc
diff --git a/components/policy/core/common/policy_loader_mac_unittest.cc b/components/policy/core/common/policy_loader_mac_unittest.cc
index 8ed6e55a3078b38bc4ff228903985a6da8f67de2..7f3c14fa94949e6fd254d66ce9a3eeb1d709c0c2 100644
--- a/components/policy/core/common/policy_loader_mac_unittest.cc
+++ b/components/policy/core/common/policy_loader_mac_unittest.cc
@@ -13,6 +13,7 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
#include "components/policy/core/common/async_policy_provider.h"
@@ -176,7 +177,8 @@ TEST_F(PolicyLoaderMacTest, Invalid) {
// Make the provider read the updated |prefs_|.
provider_->RefreshPolicies();
- loop_.RunUntilIdle();
+ ASSERT_TRUE(base::MessageLoopForIO::IsCurrent());
+ base::RunLoop().RunUntilIdle();
const PolicyBundle kEmptyBundle;
EXPECT_TRUE(provider_->policies().Equals(kEmptyBundle));
}
@@ -191,7 +193,8 @@ TEST_F(PolicyLoaderMacTest, TestNonForcedValue) {
// Make the provider read the updated |prefs_|.
provider_->RefreshPolicies();
- loop_.RunUntilIdle();
+ ASSERT_TRUE(base::MessageLoopForIO::IsCurrent());
+ base::RunLoop().RunUntilIdle();
PolicyBundle expected_bundle;
expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
.Set(test_keys::kKeyString, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698