| 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/power/tablet_power_button_controller.h" | 5 #include "ash/system/power/tablet_power_button_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/public/cpp/config.h" | 10 #include "ash/public/cpp/config.h" |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 ->tablet_power_button_controller_for_test(); | 551 ->tablet_power_button_controller_for_test(); |
| 552 EXPECT_FALSE(tablet_controller_); | 552 EXPECT_FALSE(tablet_controller_); |
| 553 | 553 |
| 554 SendAccelerometerUpdate(); | 554 SendAccelerometerUpdate(); |
| 555 tablet_controller_ = Shell::Get() | 555 tablet_controller_ = Shell::Get() |
| 556 ->power_button_controller() | 556 ->power_button_controller() |
| 557 ->tablet_power_button_controller_for_test(); | 557 ->tablet_power_button_controller_for_test(); |
| 558 EXPECT_TRUE(tablet_controller_); | 558 EXPECT_TRUE(tablet_controller_); |
| 559 } | 559 } |
| 560 | 560 |
| 561 // Tests that when backlights get forced off due to tablet power button, media |
| 562 // sessions should be suspended. |
| 563 TEST_F(TabletPowerButtonControllerTest, SuspendMediaSessions) { |
| 564 ASSERT_FALSE(shell_delegate_->media_sessions_suspended()); |
| 565 PressPowerButton(); |
| 566 ReleasePowerButton(); |
| 567 ASSERT_TRUE(GetBacklightsForcedOff()); |
| 568 EXPECT_TRUE(shell_delegate_->media_sessions_suspended()); |
| 569 } |
| 570 |
| 561 } // namespace test | 571 } // namespace test |
| 562 } // namespace ash | 572 } // namespace ash |
| OLD | NEW |