| 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/ash_switches.h" | |
| 8 #include "ash/common/login_status.h" | 7 #include "ash/common/login_status.h" |
| 9 #include "ash/common/shelf/shelf_types.h" | 8 #include "ash/common/shelf/shelf_types.h" |
| 10 #include "ash/common/system/status_area_widget.h" | 9 #include "ash/common/system/status_area_widget.h" |
| 11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 12 #include "ash/common/wm/overview/window_selector_controller.h" | 11 #include "ash/common/wm/overview/window_selector_controller.h" |
| 13 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
| 14 #include "ash/display/display_manager.h" | 13 #include "ash/display/display_manager.h" |
| 15 #include "ash/root_window_controller.h" | 14 #include "ash/root_window_controller.h" |
| 16 #include "ash/rotator/screen_rotation_animator.h" | 15 #include "ash/rotator/screen_rotation_animator.h" |
| 17 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 18 #include "ash/test/ash_test_base.h" | 17 #include "ash/test/ash_test_base.h" |
| 19 #include "ash/test/ash_test_helper.h" | 18 #include "ash/test/ash_test_helper.h" |
| 20 #include "ash/test/status_area_widget_test_helper.h" | 19 #include "ash/test/status_area_widget_test_helper.h" |
| 21 #include "ash/test/test_session_state_delegate.h" | 20 #include "ash/test/test_session_state_delegate.h" |
| 22 #include "base/command_line.h" | 21 #include "base/command_line.h" |
| 23 #include "base/test/user_action_tester.h" | 22 #include "base/test/user_action_tester.h" |
| 24 #include "base/time/time.h" | 23 #include "base/time/time.h" |
| 25 #include "ui/aura/client/aura_constants.h" | 24 #include "ui/aura/client/aura_constants.h" |
| 26 #include "ui/aura/window.h" | 25 #include "ui/aura/window.h" |
| 27 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 26 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 27 #include "ui/display/display_switches.h" |
| 28 #include "ui/events/event.h" | 28 #include "ui/events/event.h" |
| 29 #include "ui/events/event_constants.h" | 29 #include "ui/events/event_constants.h" |
| 30 #include "ui/events/gestures/gesture_types.h" | 30 #include "ui/events/gestures/gesture_types.h" |
| 31 #include "ui/views/controls/image_view.h" | 31 #include "ui/views/controls/image_view.h" |
| 32 | 32 |
| 33 namespace ash { | 33 namespace ash { |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 const char kTrayOverview[] = "Tray_Overview"; | 37 const char kTrayOverview[] = "Tray_Overview"; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 62 views::ImageView* GetImageView(OverviewButtonTray* tray) { | 62 views::ImageView* GetImageView(OverviewButtonTray* tray) { |
| 63 return tray->icon_; | 63 return tray->icon_; |
| 64 } | 64 } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 DISALLOW_COPY_AND_ASSIGN(OverviewButtonTrayTest); | 67 DISALLOW_COPY_AND_ASSIGN(OverviewButtonTrayTest); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 void OverviewButtonTrayTest::SetUp() { | 70 void OverviewButtonTrayTest::SetUp() { |
| 71 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 71 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 72 switches::kAshUseFirstDisplayAsInternal); | 72 ::switches::kUseFirstDisplayAsInternal); |
| 73 AshTestBase::SetUp(); | 73 AshTestBase::SetUp(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void OverviewButtonTrayTest::NotifySessionStateChanged() { | 76 void OverviewButtonTrayTest::NotifySessionStateChanged() { |
| 77 GetTray()->SessionStateChanged( | 77 GetTray()->SessionStateChanged( |
| 78 test::AshTestHelper::GetTestSessionStateDelegate()->GetSessionState()); | 78 test::AshTestHelper::GetTestSessionStateDelegate()->GetSessionState()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 // Ensures that creation doesn't cause any crashes and adds the image icon. | 81 // Ensures that creation doesn't cause any crashes and adds the image icon. |
| 82 TEST_F(OverviewButtonTrayTest, BasicConstruction) { | 82 TEST_F(OverviewButtonTrayTest, BasicConstruction) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); | 260 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); |
| 261 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 261 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 262 true); | 262 true); |
| 263 EXPECT_TRUE(GetTray()->visible()); | 263 EXPECT_TRUE(GetTray()->visible()); |
| 264 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 264 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 265 false); | 265 false); |
| 266 EXPECT_FALSE(GetTray()->visible()); | 266 EXPECT_FALSE(GetTray()->visible()); |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace ash | 269 } // namespace ash |
| OLD | NEW |