OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/common/system/overview/overview_button_tray.h" | 5 #include "ash/common/system/overview/overview_button_tray.h" |
6 | 6 |
7 #include "ash/common/login_status.h" | 7 #include "ash/common/login_status.h" |
| 8 #include "ash/common/session/session_controller.h" |
8 #include "ash/common/system/status_area_widget.h" | 9 #include "ash/common/system/status_area_widget.h" |
9 #include "ash/common/test/test_session_state_delegate.h" | |
10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
11 #include "ash/common/wm/overview/window_selector_controller.h" | 11 #include "ash/common/wm/overview/window_selector_controller.h" |
12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
13 #include "ash/public/cpp/shelf_types.h" | 13 #include "ash/public/cpp/shelf_types.h" |
14 #include "ash/root_window_controller.h" | 14 #include "ash/root_window_controller.h" |
15 #include "ash/rotator/screen_rotation_animator.h" | 15 #include "ash/rotator/screen_rotation_animator.h" |
16 #include "ash/test/ash_test_base.h" | 16 #include "ash/test/ash_test_base.h" |
17 #include "ash/test/ash_test_helper.h" | 17 #include "ash/test/ash_test_helper.h" |
18 #include "ash/test/status_area_widget_test_helper.h" | 18 #include "ash/test/status_area_widget_test_helper.h" |
19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 }; | 66 }; |
67 | 67 |
68 void OverviewButtonTrayTest::SetUp() { | 68 void OverviewButtonTrayTest::SetUp() { |
69 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 69 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
70 ::switches::kUseFirstDisplayAsInternal); | 70 ::switches::kUseFirstDisplayAsInternal); |
71 AshTestBase::SetUp(); | 71 AshTestBase::SetUp(); |
72 } | 72 } |
73 | 73 |
74 void OverviewButtonTrayTest::NotifySessionStateChanged() { | 74 void OverviewButtonTrayTest::NotifySessionStateChanged() { |
75 GetTray()->SessionStateChanged( | 75 GetTray()->SessionStateChanged( |
76 test::AshTestHelper::GetTestSessionStateDelegate()->GetSessionState()); | 76 WmShell::Get()->session_controller()->GetSessionState()); |
77 } | 77 } |
78 | 78 |
79 // Ensures that creation doesn't cause any crashes and adds the image icon. | 79 // Ensures that creation doesn't cause any crashes and adds the image icon. |
80 TEST_F(OverviewButtonTrayTest, BasicConstruction) { | 80 TEST_F(OverviewButtonTrayTest, BasicConstruction) { |
81 EXPECT_TRUE(GetImageView(GetTray()) != NULL); | 81 EXPECT_TRUE(GetImageView(GetTray()) != NULL); |
82 } | 82 } |
83 | 83 |
84 // Test that maximize mode toggle changes visibility. | 84 // Test that maximize mode toggle changes visibility. |
85 // OverviewButtonTray should only be visible when MaximizeMode is enabled. | 85 // OverviewButtonTray should only be visible when MaximizeMode is enabled. |
86 // By default the system should not have MaximizeMode enabled. | 86 // By default the system should not have MaximizeMode enabled. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); | 253 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); |
254 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 254 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
255 true); | 255 true); |
256 EXPECT_TRUE(GetTray()->visible()); | 256 EXPECT_TRUE(GetTray()->visible()); |
257 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 257 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
258 false); | 258 false); |
259 EXPECT_FALSE(GetTray()->visible()); | 259 EXPECT_FALSE(GetTray()->visible()); |
260 } | 260 } |
261 | 261 |
262 } // namespace ash | 262 } // namespace ash |
OLD | NEW |