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

Unified Diff: device/geolocation/wifi_data_provider_chromeos_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_chromeos_unittest.cc
diff --git a/device/geolocation/wifi_data_provider_chromeos_unittest.cc b/device/geolocation/wifi_data_provider_chromeos_unittest.cc
index 9234cb0c3b257f2a859f7c4ffd0a864524a073a9..66d750ec1eba984a1e9b8aa81fd02510f92458ca 100644
--- a/device/geolocation/wifi_data_provider_chromeos_unittest.cc
+++ b/device/geolocation/wifi_data_provider_chromeos_unittest.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_loop/message_loop.h"
+#include "device/geolocation/wifi_data_provider_chromeos.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_task_environment.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/shill_manager_client.h"
#include "chromeos/network/geolocation_handler.h"
-#include "device/geolocation/wifi_data_provider_chromeos.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -18,7 +18,9 @@ namespace device {
class GeolocationChromeOsWifiDataProviderTest : public testing::Test {
protected:
- GeolocationChromeOsWifiDataProviderTest() {}
+ GeolocationChromeOsWifiDataProviderTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
void SetUp() override {
chromeos::DBusThreadManager::Initialize();
@@ -59,7 +61,7 @@ class GeolocationChromeOsWifiDataProviderTest : public testing::Test {
base::RunLoop().RunUntilIdle();
}
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
scoped_refptr<WifiDataProviderChromeOs> provider_;
chromeos::ShillManagerClient* manager_client_;
chromeos::ShillManagerClient::TestInterface* manager_test_;
« no previous file with comments | « device/geolocation/geolocation_provider_impl_unittest.cc ('k') | device/geolocation/wifi_data_provider_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698