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

Unified Diff: ui/views/animation/bounds_animator_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/views/animation/bounds_animator_unittest.cc
diff --git a/ui/views/animation/bounds_animator_unittest.cc b/ui/views/animation/bounds_animator_unittest.cc
index 39fcf7452f0dc6acd56e22b9f9fd90ba2c381818..000c0c3efbc91ab83270ef2f32981274e8ac20ad 100644
--- a/ui/views/animation/bounds_animator_unittest.cc
+++ b/ui/views/animation/bounds_animator_unittest.cc
@@ -6,6 +6,7 @@
#include "base/macros.h"
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/animation/slide_animation.h"
#include "ui/gfx/animation/test_animation_delegate.h"
@@ -91,7 +92,11 @@ class TestView : public View {
class BoundsAnimatorTest : public testing::Test {
public:
- BoundsAnimatorTest() : child_(new TestView()), animator_(&parent_) {
+ BoundsAnimatorTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ child_(new TestView()),
+ animator_(&parent_) {
parent_.AddChildView(child_);
}
@@ -100,7 +105,7 @@ class BoundsAnimatorTest : public testing::Test {
TestBoundsAnimator* animator() { return &animator_; }
private:
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
TestView parent_;
TestView* child_; // Owned by |parent_|.
TestBoundsAnimator animator_;

Powered by Google App Engine
This is Rietveld 408576698