Commit 142a0b6e authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Backport some tests in /ui/views to SingleThreadTaskEnvironment

These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of crbug.com/891670.

//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for
/ui/views.

This CL is a no-op if it passes CQ.

This CL was uploaded by git cl split.

Edit: Restore full TaskEnvironment in ViewsTestBase.

R=weili@chromium.org

Bug: 891670
Change-Id: Id7d806ac0dcacb9bdeeb3e7117c659ffbb46c217
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786953Reviewed-by: default avatarWei Li <weili@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694884}
parent 8e822baa
......@@ -77,7 +77,8 @@ class TestView : public View {
class BoundsAnimatorTest : public testing::Test {
public:
BoundsAnimatorTest()
: task_environment_(base::test::TaskEnvironment::MainThreadType::UI),
: task_environment_(
base::test::SingleThreadTaskEnvironment::MainThreadType::UI),
child_(new TestView()),
animator_(&parent_) {
parent_.AddChildView(child_);
......@@ -89,7 +90,7 @@ class BoundsAnimatorTest : public testing::Test {
BoundsAnimator* animator() { return &animator_; }
private:
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
TestView parent_;
TestView* child_; // Owned by |parent_|.
BoundsAnimator animator_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment