Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(968)

Unified Diff: chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc

Issue 2640433004: ChromeOS MD: Fix cannot drag tab onto immersive fullscreen window (Closed)
Patch Set: nits for ps9 Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 5e986a69d0423db41704b6aed3dfd5c7aa2c062a..82631de52ddda74e25644482cf0847399e4bbd25 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
@@ -109,7 +109,8 @@ class ImmersiveModeControllerAshTest : public TestWithBrowserView {
};
// Test the layout and visibility of the tabstrip, toolbar and TopContainerView
-// in immersive fullscreen.
+// in immersive fullscreen. For MD, tabstrip is considered as visible with top
+// container offscreen.
TEST_F(ImmersiveModeControllerAshTest, Layout) {
AddTab(browser(), GURL("about:blank"));
@@ -131,16 +132,13 @@ TEST_F(ImmersiveModeControllerAshTest, Layout) {
EXPECT_TRUE(controller()->IsEnabled());
EXPECT_FALSE(controller()->IsRevealed());
EXPECT_FALSE(toolbar->visible());
- // For MD, the browser's top chrome is completely hidden in immersive
- // fullscreen mode.
+ // For MD, the browser's top chrome is completely offscreen with tapstrip
+ // visible.
bool is_using_material_design =
ash::MaterialDesignController::IsImmersiveModeMaterial();
- if (is_using_material_design) {
- EXPECT_FALSE(tabstrip->visible());
- } else {
- EXPECT_TRUE(tabstrip->visible());
+ EXPECT_TRUE(tabstrip->visible());
+ if (!is_using_material_design)
EXPECT_TRUE(tabstrip->IsImmersiveStyle());
- }
// The tab indicators should be flush with the top of the widget.
EXPECT_EQ(0, GetBoundsInWidget(tabstrip).y());
@@ -195,11 +193,13 @@ TEST_F(ImmersiveModeControllerAshTest, Layout) {
// both immersive and tab fullscreen.
EXPECT_EQ(0, GetBoundsInWidget(contents_web_view).y());
- // Hide the top-of-window views. Both the tab strip and the toolbar should
- // hide when in both immersive and tab fullscreen.
+ // Hide the top-of-window views. For MD, tabstrip is considered as visible.
AttemptUnreveal();
EXPECT_FALSE(controller()->IsRevealed());
- EXPECT_FALSE(tabstrip->visible());
+ if (is_using_material_design)
+ EXPECT_TRUE(tabstrip->visible());
+ else
+ EXPECT_FALSE(tabstrip->visible());
EXPECT_FALSE(toolbar->visible());
// The web contents should still be flush with the edge of the widget.
@@ -323,7 +323,8 @@ class ImmersiveModeControllerAshTestHostedApp
};
// Test the layout and visibility of the TopContainerView and web contents when
-// a hosted app is put into immersive fullscreen.
+// a hosted app is put into immersive fullscreen. For MD, tabstrip is considered
+// as visible with immersive fullsceen.
TEST_F(ImmersiveModeControllerAshTestHostedApp, Layout) {
// Add a tab because the browser starts out without any tabs at all.
AddTab(browser(), GURL("about:blank"));
@@ -352,9 +353,15 @@ TEST_F(ImmersiveModeControllerAshTestHostedApp, Layout) {
// Entering immersive fullscreen should make the web contents flush with the
// top of the widget.
- EXPECT_FALSE(tabstrip->visible());
EXPECT_FALSE(toolbar->visible());
- EXPECT_TRUE(top_container->GetVisibleBounds().IsEmpty());
+ bool is_using_material_design =
+ ash::MaterialDesignController::IsImmersiveModeMaterial();
+ if (is_using_material_design) {
+ EXPECT_TRUE(tabstrip->visible());
+ } else {
+ EXPECT_FALSE(tabstrip->visible());
+ EXPECT_TRUE(top_container->GetVisibleBounds().IsEmpty());
+ }
EXPECT_EQ(0, GetBoundsInWidget(contents_web_view).y());
// Reveal the window header.

Powered by Google App Engine
This is Rietveld 408576698