OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame/immersive_mode_controller_ash.h" | 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
8 #include "ash/common/shelf/shelf_layout_manager.h" | 8 #include "ash/common/shelf/shelf_layout_manager.h" |
9 #include "ash/public/cpp/shelf_types.h" | 9 #include "ash/public/cpp/shelf_types.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 EXPECT_TRUE(controller()->IsEnabled()); | 131 EXPECT_TRUE(controller()->IsEnabled()); |
132 EXPECT_FALSE(controller()->IsRevealed()); | 132 EXPECT_FALSE(controller()->IsRevealed()); |
133 EXPECT_FALSE(toolbar->visible()); | 133 EXPECT_FALSE(toolbar->visible()); |
134 // For MD, the browser's top chrome is completely offscreen with tapstrip | 134 // For MD, the browser's top chrome is completely offscreen with tapstrip |
135 // visible. | 135 // visible. |
136 EXPECT_TRUE(tabstrip->visible()); | 136 EXPECT_TRUE(tabstrip->visible()); |
137 bool is_using_material_design = | 137 bool is_using_material_design = |
138 ash::MaterialDesignController::IsImmersiveModeMaterial(); | 138 ash::MaterialDesignController::IsImmersiveModeMaterial(); |
139 if (!is_using_material_design) | 139 if (!is_using_material_design) |
140 EXPECT_TRUE(tabstrip->IsImmersiveStyle()); | 140 EXPECT_TRUE(tabstrip->IsImmersiveStyle()); |
| 141 // Top container view should be completely offscreen. |
| 142 EXPECT_EQ(0, GetBoundsInWidget(browser_view()->top_container()).bottom()); |
141 | 143 |
142 // The tab indicators should be flush with the top of the widget. | 144 // The tab indicators should be flush with the top of the widget. |
143 EXPECT_EQ(0, GetBoundsInWidget(tabstrip).y()); | 145 EXPECT_EQ(0, GetBoundsInWidget(tabstrip).y()); |
144 | 146 |
145 // In MD, since the tab strip and tool bar are both hidden in immersive | 147 // In MD, since the tab strip and tool bar are both hidden in immersive |
146 // fullscreen mode, the web contents should extend to the edge of screen. In | 148 // fullscreen mode, the web contents should extend to the edge of screen. In |
147 // non-MD, the web contents should be immediately below the tab indicators. | 149 // non-MD, the web contents should be immediately below the tab indicators. |
148 if (is_using_material_design) { | 150 if (is_using_material_design) { |
149 EXPECT_EQ(0, GetBoundsInWidget(contents_web_view).y()); | 151 EXPECT_EQ(0, GetBoundsInWidget(contents_web_view).y()); |
150 } else { | 152 } else { |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 374 |
373 // Exit immersive fullscreen. The web contents should be back below the window | 375 // Exit immersive fullscreen. The web contents should be back below the window |
374 // header. | 376 // header. |
375 ToggleFullscreen(); | 377 ToggleFullscreen(); |
376 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); | 378 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); |
377 EXPECT_FALSE(controller()->IsEnabled()); | 379 EXPECT_FALSE(controller()->IsEnabled()); |
378 EXPECT_FALSE(tabstrip->visible()); | 380 EXPECT_FALSE(tabstrip->visible()); |
379 EXPECT_FALSE(toolbar->visible()); | 381 EXPECT_FALSE(toolbar->visible()); |
380 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); | 382 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); |
381 } | 383 } |
OLD | NEW |