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

Unified Diff: ui/gfx/animation/animation_unittest.cc

Issue 2849603003: Use ScopedTaskEnvironment instead of MessageLoopForUI in ui tests. (Closed)
Patch Set: CR-add-newline-after-include 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: ui/gfx/animation/animation_unittest.cc
diff --git a/ui/gfx/animation/animation_unittest.cc b/ui/gfx/animation/animation_unittest.cc
index 4a37234d5e5e5f7ca37df635c980924308f89101..81462504892edba18a3b1095e28ab0e9dfabf8a4 100644
--- a/ui/gfx/animation/animation_unittest.cc
+++ b/ui/gfx/animation/animation_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/animation/animation_delegate.h"
@@ -10,14 +11,20 @@
#include "ui/gfx/animation/test_animation_delegate.h"
#if defined(OS_WIN)
+#include "base/test/scoped_task_environment.h"
#include "base/win/windows_version.h"
#endif
namespace gfx {
class AnimationTest: public testing::Test {
+ protected:
+ AnimationTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
+
private:
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
};
namespace {

Powered by Google App Engine
This is Rietveld 408576698