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

Unified Diff: device/geolocation/wifi_data_provider_common_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
Index: device/geolocation/wifi_data_provider_common_unittest.cc
diff --git a/device/geolocation/wifi_data_provider_common_unittest.cc b/device/geolocation/wifi_data_provider_common_unittest.cc
index 8afde8ca862d9d9643f5857b473d5a613f35134b..ff914d1ff6e0ef9aaeb300c90c5c08aa88573e55 100644
--- a/device/geolocation/wifi_data_provider_common_unittest.cc
+++ b/device/geolocation/wifi_data_provider_common_unittest.cc
@@ -10,6 +10,7 @@
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_task_environment.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "base/threading/thread_task_runner_handle.h"
#include "device/geolocation/wifi_data_provider_manager.h"
@@ -82,7 +83,9 @@ class WifiDataProviderCommonWithMock : public WifiDataProviderCommon {
class GeolocationWifiDataProviderCommonTest : public testing::Test {
public:
GeolocationWifiDataProviderCommonTest()
- : wifi_data_callback_(base::Bind(&base::DoNothing)),
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ wifi_data_callback_(base::Bind(&base::DoNothing)),
provider_(new WifiDataProviderCommonWithMock),
wlan_api_(provider_->wlan_api_.get()),
polling_policy_(provider_->polling_policy_.get()) {}
@@ -97,7 +100,7 @@ class GeolocationWifiDataProviderCommonTest : public testing::Test {
}
protected:
- const base::MessageLoopForUI message_loop_;
+ const base::test::ScopedTaskEnvironment scoped_task_environment_;
WifiDataProviderManager::WifiDataUpdateCallback wifi_data_callback_;
const scoped_refptr<WifiDataProviderCommonWithMock> provider_;
« no previous file with comments | « device/geolocation/wifi_data_provider_chromeos_unittest.cc ('k') | device/geolocation/wifi_data_provider_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698