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

Unified Diff: ash/test/ash_test_environment_default.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 | « ash/system/power/power_status_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_environment_default.cc
diff --git a/ash/test/ash_test_environment_default.cc b/ash/test/ash_test_environment_default.cc
index cd07b8d7d511b27c64593f29fd03b5b3ca36783d..1d2ddb3bd54fea008e96306417eff9e50a298e79 100644
--- a/ash/test/ash_test_environment_default.cc
+++ b/ash/test/ash_test_environment_default.cc
@@ -6,8 +6,8 @@
#include "ash/test/ash_test_views_delegate.h"
#include "base/memory/ptr_util.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "base/test/sequenced_worker_pool_owner.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -17,7 +17,9 @@ namespace {
class AshTestEnvironmentDefault : public AshTestEnvironment {
public:
- AshTestEnvironmentDefault() {}
+ AshTestEnvironmentDefault()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
~AshTestEnvironmentDefault() override {
base::RunLoop().RunUntilIdle();
@@ -40,7 +42,7 @@ class AshTestEnvironmentDefault : public AshTestEnvironment {
}
private:
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<base::SequencedWorkerPoolOwner> blocking_pool_owner_;
DISALLOW_COPY_AND_ASSIGN(AshTestEnvironmentDefault);
« no previous file with comments | « ash/system/power/power_status_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698