Fix TabStripTest when GetParam returns true.
In an unrelated patch I discovered that there was no difference between the two Param variables in TabStripTest. is_touch was unexpectedly still false inside GetLayoutConstants even though it should have been overridden to true by TabStripTest::test_api_ . Because ViewsTestBase was calling MaterialDesignController::Initialize() inside SetUp, the value set by TabStripTest::test_api_ was being overwritten. To fix this, the ViewsTestBase call is moved to its constructor, so that it will always happen first. This caused TabCloseButtonVisibilityWhenNotStacked/1 to fail, which was because FakeBaseTabStripController was calling TabStrip::SetSelection before TabStrip::RemoveTabAt, which seems wrong (the tab at active_index_ isn't removed yet). In non-test code, TabStripModel will call RemoveTabAt first, so this patch switches the order and fixes the test. It is unknown why TabCloseButtonVisibilityWhenNotStacked/0 was not failing. This patch also adds a test to ensure the layout is different when switching from touch UI to normal UI and vice versa. Change-Id: I447ffe0ebd99cb56ab77c23e60fa67cf09ba98f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1747175Reviewed-by:Scott Violet <sky@chromium.org> Commit-Queue: Bret Sepulveda <bsep@chromium.org> Cr-Commit-Position: refs/heads/master@{#686515}
Showing
Please register or sign in to comment