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

Unified Diff: chromeos/cryptohome/system_salt_getter_unittest.cc

Issue 2845973003: Use ScopedTaskEnvironment instead of MessageLoopForUI in chromeos tests. (Closed)
Patch Set: 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
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..59ce31f2fac8126084197fbcd9113a34719fdbb7 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,10 @@ 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),
+ fake_cryptohome_client_(NULL) {}
stevenjb 2017/04/27 18:39:10 nit: nullptr while we are here... bonus points for
fdoray 2017/04/27 20:35:03 Done.
void SetUp() override {
fake_cryptohome_client_ = new FakeCryptohomeClient;
@@ -40,7 +43,7 @@ class SystemSaltGetterTest : public testing::Test {
DBusThreadManager::Shutdown();
}
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
FakeCryptohomeClient* fake_cryptohome_client_;
};

Powered by Google App Engine
This is Rietveld 408576698