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

Unified Diff: chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc

Issue 2851593002: Use ScopedTaskEnvironment instead of MessageLoopForUI in chrome tests. (Closed)
Patch Set: fix-build-error Created 3 years, 8 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 | « no previous file | chrome/browser/chromeos/settings/install_attributes_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
index 5e780fb2bfd9fecfa5c59052077b82d93a678f38..7a7d2f546613c5cb6c7298a006497bb532a7ec8f 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
@@ -15,9 +15,9 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/test/scoped_task_environment.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chromeos/dbus/mock_cryptohome_client.h"
@@ -62,7 +62,9 @@ ACTION_P2(SendSanitizedUsername, call_status, sanitized_username) {
class UserCloudPolicyStoreChromeOSTest : public testing::Test {
protected:
- UserCloudPolicyStoreChromeOSTest() {}
+ UserCloudPolicyStoreChromeOSTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
void SetUp() override {
EXPECT_CALL(cryptohome_client_, GetSanitizedUsername(cryptohome_id_, _))
@@ -72,8 +74,9 @@ class UserCloudPolicyStoreChromeOSTest : public testing::Test {
ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir());
store_.reset(new UserCloudPolicyStoreChromeOS(
- &cryptohome_client_, &session_manager_client_, loop_.task_runner(),
- account_id_, user_policy_dir(), false /* is_active_directory */));
+ &cryptohome_client_, &session_manager_client_,
+ base::ThreadTaskRunnerHandle::Get(), account_id_, user_policy_dir(),
+ false /* is_active_directory */));
store_->AddObserver(&observer_);
// Install the initial public key, so that by default the validation of
@@ -212,7 +215,7 @@ class UserCloudPolicyStoreChromeOSTest : public testing::Test {
.AppendASCII("policy.pub");
}
- base::MessageLoopForUI loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
chromeos::MockCryptohomeClient cryptohome_client_;
chromeos::MockSessionManagerClient session_manager_client_;
UserPolicyBuilder policy_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/settings/install_attributes_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698