| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h" | 9 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h" |
| 10 #include "chrome/browser/ui/views/tabs/tab.h" | 10 #include "chrome/browser/ui/views/tabs/tab.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 int immersive_height = Tab::GetImmersiveHeight(); | 322 int immersive_height = Tab::GetImmersiveHeight(); |
| 323 EXPECT_EQ(immersive_height, tab_strip_->GetPreferredSize().height()); | 323 EXPECT_EQ(immersive_height, tab_strip_->GetPreferredSize().height()); |
| 324 | 324 |
| 325 // Sanity-check immersive tabs are shorter than normal tabs. | 325 // Sanity-check immersive tabs are shorter than normal tabs. |
| 326 EXPECT_LT(immersive_height, normal_height); | 326 EXPECT_LT(immersive_height, normal_height); |
| 327 } | 327 } |
| 328 | 328 |
| 329 // Creates a tab strip in stacked layout mode and verifies the correctness | 329 // Creates a tab strip in stacked layout mode and verifies the correctness |
| 330 // of hit tests against the visible/occluded regions of a tab and the tab | 330 // of hit tests against the visible/occluded regions of a tab and the tab |
| 331 // close button of the active tab. | 331 // close button of the active tab. |
| 332 TEST_F(TabStripTest, TabHitTestMaskWhenStacked) { | 332 // TODO(pkasting): Update the test for Material Design layout. |
| 333 // TODO(varkha,pkasting): Update the test for Material Design layout. | 333 // crbug.com/575327 |
| 334 // crbug.com/575327 | 334 TEST_F(TabStripTest, DISABLED_TabHitTestMaskWhenStacked) { |
| 335 if (ui::MaterialDesignController::IsModeMaterial()) { | |
| 336 VLOG(1) << "Test is DISABLED for material design layouts."; | |
| 337 return; | |
| 338 } | |
| 339 | |
| 340 tab_strip_->SetBounds(0, 0, 300, 20); | 335 tab_strip_->SetBounds(0, 0, 300, 20); |
| 341 | 336 |
| 342 controller_->AddTab(0, false); | 337 controller_->AddTab(0, false); |
| 343 controller_->AddTab(1, true); | 338 controller_->AddTab(1, true); |
| 344 controller_->AddTab(2, false); | 339 controller_->AddTab(2, false); |
| 345 controller_->AddTab(3, false); | 340 controller_->AddTab(3, false); |
| 346 ASSERT_EQ(4, tab_strip_->tab_count()); | 341 ASSERT_EQ(4, tab_strip_->tab_count()); |
| 347 | 342 |
| 348 Tab* left_tab = tab_strip_->tab_at(0); | 343 Tab* left_tab = tab_strip_->tab_at(0); |
| 349 left_tab->SetBoundsRect(gfx::Rect(gfx::Point(0, 0), gfx::Size(200, 20))); | 344 left_tab->SetBoundsRect(gfx::Rect(gfx::Point(0, 0), gfx::Size(200, 20))); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 | 652 |
| 658 // Change the title of the second tab (first tab is selected). | 653 // Change the title of the second tab (first tab is selected). |
| 659 tab_strip_->TabTitleChangedNotLoading(1); | 654 tab_strip_->TabTitleChangedNotLoading(1); |
| 660 // Indicator should be shown. | 655 // Indicator should be shown. |
| 661 EXPECT_TRUE(IsShowingPinnedTabTitleChangedIndicator(1)); | 656 EXPECT_TRUE(IsShowingPinnedTabTitleChangedIndicator(1)); |
| 662 // Select the second tab. | 657 // Select the second tab. |
| 663 controller_->SelectTab(1); | 658 controller_->SelectTab(1); |
| 664 // Indicator should hide. | 659 // Indicator should hide. |
| 665 EXPECT_FALSE(IsShowingPinnedTabTitleChangedIndicator(1)); | 660 EXPECT_FALSE(IsShowingPinnedTabTitleChangedIndicator(1)); |
| 666 } | 661 } |
| OLD | NEW |