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" |
(...skipping 20 matching lines...) Expand all Loading... |
31 false) { | 31 false) { |
32 } | 32 } |
33 ImmersiveModeControllerAshTest( | 33 ImmersiveModeControllerAshTest( |
34 Browser::Type browser_type, | 34 Browser::Type browser_type, |
35 chrome::HostDesktopType host_desktop_type, | 35 chrome::HostDesktopType host_desktop_type, |
36 bool hosted_app) | 36 bool hosted_app) |
37 : TestWithBrowserView(browser_type, | 37 : TestWithBrowserView(browser_type, |
38 host_desktop_type, | 38 host_desktop_type, |
39 hosted_app) { | 39 hosted_app) { |
40 } | 40 } |
41 virtual ~ImmersiveModeControllerAshTest() {} | 41 ~ImmersiveModeControllerAshTest() override {} |
42 | 42 |
43 // TestWithBrowserView override: | 43 // TestWithBrowserView override: |
44 virtual void SetUp() override { | 44 void SetUp() override { |
45 TestWithBrowserView::SetUp(); | 45 TestWithBrowserView::SetUp(); |
46 | 46 |
47 browser()->window()->Show(); | 47 browser()->window()->Show(); |
48 | 48 |
49 controller_ = browser_view()->immersive_mode_controller(); | 49 controller_ = browser_view()->immersive_mode_controller(); |
50 controller_->SetupForTest(); | 50 controller_->SetupForTest(); |
51 } | 51 } |
52 | 52 |
53 // Returns the bounds of |view| in widget coordinates. | 53 // Returns the bounds of |view| in widget coordinates. |
54 gfx::Rect GetBoundsInWidget(views::View* view) { | 54 gfx::Rect GetBoundsInWidget(views::View* view) { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 | 270 |
271 class ImmersiveModeControllerAshTestHostedApp | 271 class ImmersiveModeControllerAshTestHostedApp |
272 : public ImmersiveModeControllerAshTest { | 272 : public ImmersiveModeControllerAshTest { |
273 public: | 273 public: |
274 ImmersiveModeControllerAshTestHostedApp() | 274 ImmersiveModeControllerAshTestHostedApp() |
275 : ImmersiveModeControllerAshTest(Browser::TYPE_POPUP, | 275 : ImmersiveModeControllerAshTest(Browser::TYPE_POPUP, |
276 chrome::HOST_DESKTOP_TYPE_ASH, | 276 chrome::HOST_DESKTOP_TYPE_ASH, |
277 true) { | 277 true) { |
278 } | 278 } |
279 virtual ~ImmersiveModeControllerAshTestHostedApp() {} | 279 ~ImmersiveModeControllerAshTestHostedApp() override {} |
280 | 280 |
281 private: | 281 private: |
282 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAshTestHostedApp); | 282 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAshTestHostedApp); |
283 }; | 283 }; |
284 | 284 |
285 // Test the layout and visibility of the TopContainerView and web contents when | 285 // Test the layout and visibility of the TopContainerView and web contents when |
286 // a hosted app is put into immersive fullscreen. | 286 // a hosted app is put into immersive fullscreen. |
287 TEST_F(ImmersiveModeControllerAshTestHostedApp, Layout) { | 287 TEST_F(ImmersiveModeControllerAshTestHostedApp, Layout) { |
288 // Add a tab because the browser starts out without any tabs at all. | 288 // Add a tab because the browser starts out without any tabs at all. |
289 AddTab(browser(), GURL("about:blank")); | 289 AddTab(browser(), GURL("about:blank")); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 // Exit immersive fullscreen. The web contents should be back below the window | 336 // Exit immersive fullscreen. The web contents should be back below the window |
337 // header. | 337 // header. |
338 ToggleFullscreen(); | 338 ToggleFullscreen(); |
339 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); | 339 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); |
340 EXPECT_FALSE(controller()->IsEnabled()); | 340 EXPECT_FALSE(controller()->IsEnabled()); |
341 EXPECT_FALSE(tabstrip->visible()); | 341 EXPECT_FALSE(tabstrip->visible()); |
342 EXPECT_FALSE(toolbar->visible()); | 342 EXPECT_FALSE(toolbar->visible()); |
343 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); | 343 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); |
344 } | 344 } |
OLD | NEW |