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

Unified Diff: ash/system/power/power_status_unittest.cc

Issue 2846723004: Use ScopedTaskEnvironment instead of MessageLoopForUI in ash 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
« no previous file with comments | « no previous file | ash/test/ash_test_environment_default.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/power/power_status_unittest.cc
diff --git a/ash/system/power/power_status_unittest.cc b/ash/system/power/power_status_unittest.cc
index c329125bce37af1738e0bb15c6dc323dc32d0428..96967c2b3ef5da21b69b260da223b0b617c3043e 100644
--- a/ash/system/power/power_status_unittest.cc
+++ b/ash/system/power/power_status_unittest.cc
@@ -7,8 +7,8 @@
#include <memory>
#include "ash/resources/vector_icons/vector_icons.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 "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -38,7 +38,10 @@ class TestObserver : public PowerStatus::Observer {
class PowerStatusTest : public testing::Test {
public:
- PowerStatusTest() : power_status_(NULL) {}
+ PowerStatusTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ power_status_(NULL) {}
~PowerStatusTest() override {}
void SetUp() override {
@@ -57,7 +60,7 @@ class PowerStatusTest : public testing::Test {
}
protected:
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
PowerStatus* power_status_; // Not owned.
std::unique_ptr<TestObserver> test_observer_;
« no previous file with comments | « no previous file | ash/test/ash_test_environment_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698