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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/shelf/shelf_types.h" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
13 #include "ash/wm/window_state.h" | |
13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
14 #include "chrome/app/chrome_command_ids.h" | 15 #include "chrome/app/chrome_command_ids.h" |
15 #include "chrome/browser/ui/browser_commands.h" | 16 #include "chrome/browser/ui/browser_commands.h" |
16 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 17 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
17 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h" | 18 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h" |
18 #include "chrome/browser/ui/views/frame/browser_view.h" | 19 #include "chrome/browser/ui/views/frame/browser_view.h" |
19 #include "chrome/browser/ui/views/frame/test_with_browser_view.h" | 20 #include "chrome/browser/ui/views/frame/test_with_browser_view.h" |
20 #include "chrome/browser/ui/views/frame/top_container_view.h" | 21 #include "chrome/browser/ui/views/frame/top_container_view.h" |
21 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 22 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
22 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 23 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 // 3) Test that exiting tab fullscreen and immersive fullscreen | 256 // 3) Test that exiting tab fullscreen and immersive fullscreen |
256 // simultaneously correctly updates the shelf visibility and whether the tab | 257 // simultaneously correctly updates the shelf visibility and whether the tab |
257 // indicators should be hidden. | 258 // indicators should be hidden. |
258 SetTabFullscreen(true); | 259 SetTabFullscreen(true); |
259 ToggleFullscreen(); | 260 ToggleFullscreen(); |
260 ASSERT_FALSE(controller()->IsEnabled()); | 261 ASSERT_FALSE(controller()->IsEnabled()); |
261 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state()); | 262 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state()); |
262 EXPECT_TRUE(controller()->ShouldHideTabIndicators()); | 263 EXPECT_TRUE(controller()->ShouldHideTabIndicators()); |
263 } | 264 } |
264 | 265 |
266 // Check that the window state of a browser window gets properly marked for | |
267 // immersive mode. | |
pkotwicz
2014/06/02 22:27:58
I don't think this test is useful. ImmersiveModeCo
Mr4D (OOO till 08-26)
2014/06/03 14:36:40
Yes, it is now - and if someone changes that it mi
pkotwicz
2014/06/03 15:15:02
You could theoretically make that argument for dup
| |
268 TEST_F(ImmersiveModeControllerAshTest, WindowStateImmersiveModeFullscreen) { | |
269 AddTab(browser(), GURL("about:blank")); | |
270 | |
271 ash::wm::WindowState* window_state = | |
272 ash::wm::GetWindowState(browser()->window()->GetNativeWindow()); | |
273 | |
274 EXPECT_FALSE(window_state->in_immersive_fullscreen()); | |
275 ToggleFullscreen(); | |
276 ASSERT_TRUE(controller()->IsEnabled()); | |
277 EXPECT_TRUE(window_state->in_immersive_fullscreen()); | |
278 | |
279 ToggleFullscreen(); | |
280 ASSERT_FALSE(controller()->IsEnabled()); | |
281 EXPECT_FALSE(window_state->in_immersive_fullscreen()); | |
282 } | |
283 | |
265 class ImmersiveModeControllerAshTestHostedApp | 284 class ImmersiveModeControllerAshTestHostedApp |
266 : public ImmersiveModeControllerAshTest { | 285 : public ImmersiveModeControllerAshTest { |
267 public: | 286 public: |
268 ImmersiveModeControllerAshTestHostedApp() | 287 ImmersiveModeControllerAshTestHostedApp() |
269 : ImmersiveModeControllerAshTest(Browser::TYPE_POPUP, | 288 : ImmersiveModeControllerAshTest(Browser::TYPE_POPUP, |
270 chrome::HOST_DESKTOP_TYPE_ASH, | 289 chrome::HOST_DESKTOP_TYPE_ASH, |
271 true) { | 290 true) { |
272 } | 291 } |
273 virtual ~ImmersiveModeControllerAshTestHostedApp() {} | 292 virtual ~ImmersiveModeControllerAshTestHostedApp() {} |
274 | 293 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 | 348 |
330 // Exit immersive fullscreen. The web contents should be back below the window | 349 // Exit immersive fullscreen. The web contents should be back below the window |
331 // header. | 350 // header. |
332 ToggleFullscreen(); | 351 ToggleFullscreen(); |
333 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); | 352 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); |
334 EXPECT_FALSE(controller()->IsEnabled()); | 353 EXPECT_FALSE(controller()->IsEnabled()); |
335 EXPECT_FALSE(tabstrip->visible()); | 354 EXPECT_FALSE(tabstrip->visible()); |
336 EXPECT_FALSE(toolbar->visible()); | 355 EXPECT_FALSE(toolbar->visible()); |
337 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); | 356 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); |
338 } | 357 } |
OLD | NEW |