Commit bf2026fe authored by Collin Baker's avatar Collin Baker Committed by Commit Bot

Don't create WebUI tab strip for DevTools windows

Fixed: 1010247
Change-Id: Ic2efa71b563a339e5c9f23a76bbfbb8be5c9762a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948092
Auto-Submit: Collin Baker <collinbaker@chromium.org>
Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721207}
parent ce10667d
......@@ -2663,7 +2663,8 @@ void BrowserView::InitViews() {
void BrowserView::MaybeInitializeWebUITabStrip() {
#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
if (WebUITabStripContainerView::UseTouchableTabStrip()) {
if (browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP) &&
WebUITabStripContainerView::UseTouchableTabStrip()) {
if (!webui_tab_strip_) {
// We use |contents_container_| here so that enabling or disabling
// devtools won't affect the tab sizes. We still use only
......
......@@ -13,7 +13,9 @@
class WebUITabStripContainerViewTest : public TestWithBrowserView {
public:
WebUITabStripContainerViewTest() : touch_mode_(true) {
template <typename... Args>
explicit WebUITabStripContainerViewTest(Args... args)
: TestWithBrowserView(args...), touch_mode_(true) {
// Both the switch and |touch_mode_| are necessary since
// MaterialDesignController::Initialize() gets called at different
// times on different platforms.
......@@ -54,3 +56,19 @@ TEST_F(WebUITabStripContainerViewTest, TouchModeTransition) {
ASSERT_NE(nullptr, container);
EXPECT_TRUE(container->GetVisible());
}
class WebUITabStripDevToolsTest : public WebUITabStripContainerViewTest {
public:
WebUITabStripDevToolsTest()
: WebUITabStripContainerViewTest(Browser::TYPE_DEVTOOLS) {}
~WebUITabStripDevToolsTest() override = default;
};
// Regression test for crbug.com/1010247.
TEST_F(WebUITabStripDevToolsTest, DevToolsWindowHasNoTabStrip) {
EXPECT_EQ(nullptr, browser_view()->webui_tab_strip());
ui::test::MaterialDesignControllerTestAPI disable_touch_mode(false);
ui::test::MaterialDesignControllerTestAPI reenable_touch_mode(true);
EXPECT_EQ(nullptr, browser_view()->webui_tab_strip());
}
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