OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/system/chromeos/power/tablet_power_button_controller.h" | 5 #include "ash/system/chromeos/power/tablet_power_button_controller.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "ash/common/ash_switches.h" | 9 #include "ash/common/ash_switches.h" |
10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 TabletPowerButtonControllerTest() {} | 45 TabletPowerButtonControllerTest() {} |
46 ~TabletPowerButtonControllerTest() override {} | 46 ~TabletPowerButtonControllerTest() override {} |
47 | 47 |
48 void SetUp() override { | 48 void SetUp() override { |
49 // This also initializes DBusThreadManager. | 49 // This also initializes DBusThreadManager. |
50 std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter = | 50 std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter = |
51 chromeos::DBusThreadManager::GetSetterForTesting(); | 51 chromeos::DBusThreadManager::GetSetterForTesting(); |
52 power_manager_client_ = new chromeos::FakePowerManagerClient(); | 52 power_manager_client_ = new chromeos::FakePowerManagerClient(); |
53 dbus_setter->SetPowerManagerClient(base::WrapUnique(power_manager_client_)); | 53 dbus_setter->SetPowerManagerClient(base::WrapUnique(power_manager_client_)); |
54 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 54 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
55 switches::kAshEnableTouchViewTesting); | 55 switches::kAshEnableTouchView); |
56 AshTestBase::SetUp(); | 56 AshTestBase::SetUp(); |
57 | 57 |
58 lock_state_controller_ = Shell::GetInstance()->lock_state_controller(); | 58 lock_state_controller_ = Shell::GetInstance()->lock_state_controller(); |
59 tablet_controller_ = Shell::GetInstance() | 59 tablet_controller_ = Shell::GetInstance() |
60 ->power_button_controller() | 60 ->power_button_controller() |
61 ->tablet_power_button_controller_for_test(); | 61 ->tablet_power_button_controller_for_test(); |
62 test_api_ = base::MakeUnique<TabletPowerButtonController::TestApi>( | 62 test_api_ = base::MakeUnique<TabletPowerButtonController::TestApi>( |
63 tablet_controller_); | 63 tablet_controller_); |
64 lock_state_test_api_ = | 64 lock_state_test_api_ = |
65 base::MakeUnique<LockStateControllerTestApi>(lock_state_controller_); | 65 base::MakeUnique<LockStateControllerTestApi>(lock_state_controller_); |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 tablet_controller_->OnMaximizeModeEnded(); | 434 tablet_controller_->OnMaximizeModeEnded(); |
435 EXPECT_FALSE(lock_state_test_api_->shutdown_timer_is_running()); | 435 EXPECT_FALSE(lock_state_test_api_->shutdown_timer_is_running()); |
436 tick_clock_->Advance(base::TimeDelta::FromMilliseconds(4500)); | 436 tick_clock_->Advance(base::TimeDelta::FromMilliseconds(4500)); |
437 power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks()); | 437 power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks()); |
438 EXPECT_FALSE(GetLockedState()); | 438 EXPECT_FALSE(GetLockedState()); |
439 EXPECT_FALSE(GetBacklightsForcedOff()); | 439 EXPECT_FALSE(GetBacklightsForcedOff()); |
440 } | 440 } |
441 | 441 |
442 } // namespace test | 442 } // namespace test |
443 } // namespace ash | 443 } // namespace ash |
OLD | NEW |