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

Unified Diff: device/u2f/u2f_register_unittest.cc

Issue 2849613002: Use ScopedTaskEnvironment instead of MessageLoopForUI in device tests. (Closed)
Patch Set: self-review 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 | « device/geolocation/wifi_data_provider_linux_unittest.cc ('k') | device/u2f/u2f_request_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/u2f/u2f_register_unittest.cc
diff --git a/device/u2f/u2f_register_unittest.cc b/device/u2f/u2f_register_unittest.cc
index 6b183da56e302e3a9645a0f0a54a966360a08a1b..5bb55e461aaf531295a81361cbb61bfcf0f56a11 100644
--- a/device/u2f/u2f_register_unittest.cc
+++ b/device/u2f/u2f_register_unittest.cc
@@ -5,6 +5,7 @@
#include <list>
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "base/test/test_io_thread.h"
#include "device/base/mock_device_client.h"
#include "device/hid/mock_hid_service.h"
@@ -17,7 +18,10 @@ namespace device {
class U2fRegisterTest : public testing::Test {
public:
- U2fRegisterTest() : io_thread_(base::TestIOThread::kAutoStart) {}
+ U2fRegisterTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ io_thread_(base::TestIOThread::kAutoStart) {}
void SetUp() override {
MockHidService* hid_service = device_client_.hid_service();
@@ -25,7 +29,7 @@ class U2fRegisterTest : public testing::Test {
}
protected:
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
base::TestIOThread io_thread_;
device::MockDeviceClient device_client_;
};
« no previous file with comments | « device/geolocation/wifi_data_provider_linux_unittest.cc ('k') | device/u2f/u2f_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698