| Index: chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc
|
| diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc
|
| index 47b90161e3e225ffcd1bbb4b8ac0ea33f2e984fc..b0d10e332c008255bd4fcfb9a0cc01bdf710d11d 100644
|
| --- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc
|
| +++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h"
|
|
|
| #include "ash/common/ash_switches.h"
|
| +#include "ash/common/material_design/material_design_controller.h"
|
| #include "ash/common/shelf/shelf_types.h"
|
| #include "ash/root_window_controller.h"
|
| #include "ash/shelf/shelf_layout_manager.h"
|
| @@ -125,19 +126,30 @@ TEST_F(ImmersiveModeControllerAshTest, Layout) {
|
| EXPECT_TRUE(browser_view()->GetWidget()->IsFullscreen());
|
| EXPECT_TRUE(controller()->IsEnabled());
|
| EXPECT_FALSE(controller()->IsRevealed());
|
| -
|
| - // Entering immersive fullscreen should make the tab strip use the immersive
|
| - // style and hide the toolbar.
|
| - EXPECT_TRUE(tabstrip->visible());
|
| - EXPECT_TRUE(tabstrip->IsImmersiveStyle());
|
| EXPECT_FALSE(toolbar->visible());
|
| + // For MD, the browser's top chrome is completely hidden in immersive
|
| + // fullscreen mode.
|
| + bool is_using_material_design =
|
| + ash::MaterialDesignController::IsShelfMaterial();
|
| + if (is_using_material_design) {
|
| + EXPECT_FALSE(tabstrip->visible());
|
| + } else {
|
| + EXPECT_TRUE(tabstrip->visible());
|
| + EXPECT_TRUE(tabstrip->IsImmersiveStyle());
|
| + }
|
|
|
| // The tab indicators should be flush with the top of the widget.
|
| EXPECT_EQ(0, GetBoundsInWidget(tabstrip).y());
|
|
|
| - // The web contents should be immediately below the tab indicators.
|
| - EXPECT_EQ(Tab::GetImmersiveHeight(),
|
| - GetBoundsInWidget(contents_web_view).y());
|
| + // In MD, since the tab strip and tool bar are both hidden in immersive
|
| + // fullscreen mode, the web contents should extend to the edge of screen. In
|
| + // non-MD, the web contents should be immediately below the tab indicators.
|
| + if (is_using_material_design) {
|
| + EXPECT_EQ(0, GetBoundsInWidget(contents_web_view).y());
|
| + } else {
|
| + EXPECT_EQ(Tab::GetImmersiveHeight(),
|
| + GetBoundsInWidget(contents_web_view).y());
|
| + }
|
|
|
| // Revealing the top-of-window views should set the tab strip back to the
|
| // normal style and show the toolbar.
|
| @@ -154,8 +166,12 @@ TEST_F(ImmersiveModeControllerAshTest, Layout) {
|
|
|
| // The web contents should be at the same y position as they were when the
|
| // top-of-window views were hidden.
|
| - EXPECT_EQ(Tab::GetImmersiveHeight(),
|
| - GetBoundsInWidget(contents_web_view).y());
|
| + if (is_using_material_design) {
|
| + EXPECT_EQ(0, GetBoundsInWidget(contents_web_view).y());
|
| + } else {
|
| + EXPECT_EQ(Tab::GetImmersiveHeight(),
|
| + GetBoundsInWidget(contents_web_view).y());
|
| + }
|
|
|
| // Repeat the test for when in both immersive fullscreen and tab fullscreen.
|
| SetTabFullscreen(true);
|
| @@ -236,22 +252,27 @@ TEST_F(ImmersiveModeControllerAshTest, TabAndBrowserFullscreen) {
|
|
|
| // 1) Test that entering tab fullscreen from immersive fullscreen hides the
|
| // tab indicators and the shelf.
|
| + // Note that tab indicators are removed from MD, so ShouldHideTabIndicators()
|
| + // always returns true.
|
| ToggleFullscreen();
|
| ASSERT_TRUE(controller()->IsEnabled());
|
| EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state());
|
| - EXPECT_FALSE(controller()->ShouldHideTabIndicators());
|
| + if (!ash::MaterialDesignController::IsShelfMaterial())
|
| + EXPECT_FALSE(controller()->ShouldHideTabIndicators());
|
|
|
| SetTabFullscreen(true);
|
| ASSERT_TRUE(controller()->IsEnabled());
|
| EXPECT_EQ(ash::SHELF_HIDDEN, shelf->visibility_state());
|
| - EXPECT_TRUE(controller()->ShouldHideTabIndicators());
|
| + if (!ash::MaterialDesignController::IsShelfMaterial())
|
| + EXPECT_TRUE(controller()->ShouldHideTabIndicators());
|
|
|
| // 2) Test that exiting tab fullscreen shows the tab indicators and autohides
|
| // the shelf.
|
| SetTabFullscreen(false);
|
| ASSERT_TRUE(controller()->IsEnabled());
|
| EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state());
|
| - EXPECT_FALSE(controller()->ShouldHideTabIndicators());
|
| + if (!ash::MaterialDesignController::IsShelfMaterial())
|
| + EXPECT_FALSE(controller()->ShouldHideTabIndicators());
|
|
|
| // 3) Test that exiting tab fullscreen and immersive fullscreen
|
| // simultaneously correctly updates the shelf visibility and whether the tab
|
| @@ -260,7 +281,8 @@ TEST_F(ImmersiveModeControllerAshTest, TabAndBrowserFullscreen) {
|
| ToggleFullscreen();
|
| ASSERT_FALSE(controller()->IsEnabled());
|
| EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state());
|
| - EXPECT_TRUE(controller()->ShouldHideTabIndicators());
|
| + if (!ash::MaterialDesignController::IsShelfMaterial())
|
| + EXPECT_TRUE(controller()->ShouldHideTabIndicators());
|
| }
|
|
|
| // Ensure the circular tab-loading throbbers are not painted as layers in
|
|
|