| 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 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/wm/cursor_manager.h" |
| 9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time.h" | 11 #include "base/time.h" |
| 11 #include "ui/aura/cursor_manager.h" | |
| 12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 13 #include "ui/aura/root_window.h" | 13 #include "ui/aura/root_window.h" |
| 14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
| 15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
| 16 | 16 |
| 17 namespace ash { | 17 namespace ash { |
| 18 namespace test { | 18 namespace test { |
| 19 namespace { | 19 namespace { |
| 20 bool cursor_visible() { | 20 bool cursor_visible() { |
| 21 return aura::Env::GetInstance()->cursor_manager()->cursor_visible(); | 21 return ash::Shell::GetInstance()->cursor_manager()->cursor_visible(); |
| 22 } | 22 } |
| 23 } | 23 } |
| 24 | 24 |
| 25 // Fake implementation of PowerButtonControllerDelegate that just logs requests | 25 // Fake implementation of PowerButtonControllerDelegate that just logs requests |
| 26 // to lock the screen and shut down the device. | 26 // to lock the screen and shut down the device. |
| 27 class TestPowerButtonControllerDelegate : public PowerButtonControllerDelegate { | 27 class TestPowerButtonControllerDelegate : public PowerButtonControllerDelegate { |
| 28 public: | 28 public: |
| 29 TestPowerButtonControllerDelegate() | 29 TestPowerButtonControllerDelegate() |
| 30 : num_lock_requests_(0), | 30 : num_lock_requests_(0), |
| 31 num_shutdown_requests_(0) {} | 31 num_shutdown_requests_(0) {} |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 | 558 |
| 559 // After increasing the brightness to 10%, we should start the timer like | 559 // After increasing the brightness to 10%, we should start the timer like |
| 560 // usual. | 560 // usual. |
| 561 controller_->OnScreenBrightnessChanged(10.0); | 561 controller_->OnScreenBrightnessChanged(10.0); |
| 562 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); | 562 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |
| 563 EXPECT_TRUE(test_api_->lock_timer_is_running()); | 563 EXPECT_TRUE(test_api_->lock_timer_is_running()); |
| 564 } | 564 } |
| 565 | 565 |
| 566 } // namespace test | 566 } // namespace test |
| 567 } // namespace ash | 567 } // namespace ash |
| OLD | NEW |