OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/wm/power_button_controller.h" | 5 #include "ash/wm/power_button_controller.h" |
6 #include "ash/wm/session_state_animator.h" | 6 #include "ash/wm/session_state_animator.h" |
7 #include "ash/wm/session_state_controller.h" | 7 #include "ash/wm/session_state_controller.h" |
8 #include "ash/wm/session_state_controller_impl.h" | 8 #include "ash/wm/session_state_controller_impl.h" |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.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/test/test_shell_delegate.h" | 13 #include "ash/test/test_shell_delegate.h" |
14 #include "ash/wm/cursor_manager.h" | 14 #include "ash/wm/cursor_manager.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
19 #include "ui/aura/root_window.h" | 19 #include "ui/aura/root_window.h" |
20 #include "ui/aura/test/event_generator.h" | 20 #include "ui/aura/test/event_generator.h" |
21 #include "ui/gfx/rect.h" | 21 #include "ui/gfx/rect.h" |
22 #include "ui/gfx/size.h" | 22 #include "ui/gfx/size.h" |
23 | 23 |
24 namespace ash { | 24 namespace ash { |
25 namespace test { | 25 namespace test { |
26 namespace { | 26 namespace { |
27 bool cursor_visible() { | 27 bool cursor_visible() { |
28 return ash::Shell::GetInstance()->cursor_manager()->cursor_visible(); | 28 return ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible(); |
29 } | 29 } |
30 } | 30 } |
31 | 31 |
32 // Fake implementation of PowerButtonControllerDelegate that just logs requests | 32 // Fake implementation of PowerButtonControllerDelegate that just logs requests |
33 // to lock the screen and shut down the device. | 33 // to lock the screen and shut down the device. |
34 class TestPowerButtonControllerDelegate : | 34 class TestPowerButtonControllerDelegate : |
35 public SessionStateControllerDelegate { | 35 public SessionStateControllerDelegate { |
36 public: | 36 public: |
37 TestPowerButtonControllerDelegate() | 37 TestPowerButtonControllerDelegate() |
38 : num_lock_requests_(0), | 38 : num_lock_requests_(0), |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 | 624 |
625 // After increasing the brightness to 10%, we should start the timer like | 625 // After increasing the brightness to 10%, we should start the timer like |
626 // usual. | 626 // usual. |
627 controller_->OnScreenBrightnessChanged(10.0); | 627 controller_->OnScreenBrightnessChanged(10.0); |
628 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); | 628 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |
629 EXPECT_TRUE(test_api_->lock_timer_is_running()); | 629 EXPECT_TRUE(test_api_->lock_timer_is_running()); |
630 } | 630 } |
631 | 631 |
632 } // namespace test | 632 } // namespace test |
633 } // namespace ash | 633 } // namespace ash |
OLD | NEW |