Commit 44c9578e authored by Charlene Yan's avatar Charlene Yan Committed by Commit Bot

Reland "[Tab Scrolling] Add test for tabstrip resizing when dragging."

This reverts commit 2c73aa66.

Reason for revert: Disabling test on linux
Original change's description:
> Revert "[Tab Scrolling] Add test for tabstrip resizing when dragging."
>
> This reverts commit a4b670d5.
>
> Reason for revert: Test is flaky/failing on https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests
>
> https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests/95514?
>
> ../../chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc:2470: Failure
> Expected equality of these values:
>   tab_strip_width + TabStyle::GetStandardWidth()
>     Which is: 751
>   tab_strip->width()
>     Which is: 761
>
> Original change's description:
> > [Tab Scrolling] Add test for tabstrip resizing when dragging.
> >
> > When the browser window is large enough, the tabstrip should expand to
> > accommodate tabs dragging past the last tab. This is a test for
> > crrev.com/c/2472577
> >
> > Bug: 1141674
> > Change-Id: Icfb4b0d6b9ebfa243a0e352b0cef68a2a6f2c263
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537068
> > Reviewed-by: Taylor Bergquist <tbergquist@chromium.org>
> > Commit-Queue: Charlene Yan <cyan@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#827998}
>
> TBR=tbergquist@chromium.org,cyan@chromium.org
>
> Change-Id: Iaee8c99d3a53eb4f1031d969b01e39d86febe6a3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1141674
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2545744
> Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#828425}

TBR=mek@chromium.org,tbergquist@chromium.org,cyan@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1141674
Change-Id: If7b71337950554f49dc9d635dbb2a2a35f0c280c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2559577Reviewed-by: default avatarCharlene Yan <cyan@chromium.org>
Commit-Queue: Charlene Yan <cyan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831141}
parent 278b1a61
......@@ -37,6 +37,7 @@
#include "chrome/browser/ui/tabs/tab_group.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_style.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/native_browser_frame_factory.h"
......@@ -2447,6 +2448,48 @@ IN_PROC_BROWSER_TEST_P(
EXPECT_EQ(browser2_groups[0], group);
}
class DetachToBrowserTabDragControllerTestWithScrollableTabStripEnabled
: public DetachToBrowserTabDragControllerTest {
public:
DetachToBrowserTabDragControllerTestWithScrollableTabStripEnabled() {
scoped_feature_list_.InitWithFeatures({features::kScrollableTabStrip}, {});
}
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
#if defined(OS_LINUX)
#define MAYBE_DraggingRightExpandsTabStripSize \
DISABLED_DraggingRightExpandsTabStripSize
#else
#define MAYBE_DraggingRightExpandsTabStripSize DraggingRightExpandsTabStripSize
#endif
// Creates a browser with two tabs and drags the rightmost tab. Given the
// browser window is large enough, the tabstrip should expand to accommodate
// this tab. Note: There must be at least two tabs because dragging a singular
// tab will drag the window.
// Disabled for Linux due to test dragging flakiness.
IN_PROC_BROWSER_TEST_P(
DetachToBrowserTabDragControllerTestWithScrollableTabStripEnabled,
MAYBE_DraggingRightExpandsTabStripSize) {
TabStrip* tab_strip = GetTabStripForBrowser(browser());
AddTabsAndResetBrowser(browser(), 1);
browser()->window()->SetBounds(
gfx::Rect(0, 0, TabStyle::GetStandardWidth() * 4, 400));
const int tab_strip_width = tab_strip->width();
const gfx::Point tab_1_center =
GetCenterInScreenCoordinates(tab_strip->tab_at(1));
ASSERT_TRUE(PressInput(tab_1_center));
ASSERT_TRUE(DragInputTo(tab_1_center +
gfx::Vector2d(TabStyle::GetStandardWidth(), 0)));
EXPECT_EQ(tab_strip_width + TabStyle::GetStandardWidth(), tab_strip->width());
ASSERT_TRUE(ReleaseInput());
}
namespace {
// Invoked from the nested run loop.
......@@ -4369,6 +4412,10 @@ INSTANTIATE_TEST_SUITE_P(
TabDragging,
DetachToBrowserTabDragControllerTestWithTabGroupsCollapseEnabled,
::testing::Values("mouse", "touch"));
INSTANTIATE_TEST_SUITE_P(
TabDragging,
DetachToBrowserTabDragControllerTestWithScrollableTabStripEnabled,
::testing::Values("mouse", "touch"));
INSTANTIATE_TEST_SUITE_P(TabDragging,
DetachToBrowserInSeparateDisplayTabDragControllerTest,
::testing::Values("mouse"));
......@@ -4394,4 +4441,8 @@ INSTANTIATE_TEST_SUITE_P(
TabDragging,
DetachToBrowserTabDragControllerTestWithTabGroupsCollapseEnabled,
::testing::Values("mouse"));
INSTANTIATE_TEST_SUITE_P(
TabDragging,
DetachToBrowserTabDragControllerTestWithScrollableTabStripEnabled,
::testing::Values("mouse"));
#endif
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