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

Unified Diff: chromeos/cryptohome/system_salt_getter_unittest.cc

Issue 2845973003: Use ScopedTaskEnvironment instead of MessageLoopForUI in chromeos tests. (Closed)
Patch Set: CR 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 | « chromeos/audio/cras_audio_handler_unittest.cc ('k') | chromeos/network/firewall_hole_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/cryptohome/system_salt_getter_unittest.cc
diff --git a/chromeos/cryptohome/system_salt_getter_unittest.cc b/chromeos/cryptohome/system_salt_getter_unittest.cc
index 5234129b35e84d77f733d3f6933c0a463ef08253..b7f618f0ea3232ea355583c0931fe43a93fbd05d 100644
--- a/chromeos/cryptohome/system_salt_getter_unittest.cc
+++ b/chromeos/cryptohome/system_salt_getter_unittest.cc
@@ -5,8 +5,8 @@
#include "chromeos/cryptohome/system_salt_getter.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/fake_cryptohome_client.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -22,7 +22,9 @@ void CopySystemSalt(std::string* out_system_salt,
class SystemSaltGetterTest : public testing::Test {
protected:
- SystemSaltGetterTest() : fake_cryptohome_client_(NULL) {}
+ SystemSaltGetterTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
void SetUp() override {
fake_cryptohome_client_ = new FakeCryptohomeClient;
@@ -40,8 +42,8 @@ class SystemSaltGetterTest : public testing::Test {
DBusThreadManager::Shutdown();
}
- base::MessageLoopForUI message_loop_;
- FakeCryptohomeClient* fake_cryptohome_client_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
+ FakeCryptohomeClient* fake_cryptohome_client_ = nullptr;
};
TEST_F(SystemSaltGetterTest, GetSystemSalt) {
« no previous file with comments | « chromeos/audio/cras_audio_handler_unittest.cc ('k') | chromeos/network/firewall_hole_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698