| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 Shell::Get() | 521 Shell::Get() |
| 522 ->power_button_controller() | 522 ->power_button_controller() |
| 523 ->ResetTabletPowerButtonControllerForTest(); | 523 ->ResetTabletPowerButtonControllerForTest(); |
| 524 | 524 |
| 525 // Check that the local state of touchscreen enabled state is in line with | 525 // Check that the local state of touchscreen enabled state is in line with |
| 526 // backlights forced off state. | 526 // backlights forced off state. |
| 527 EXPECT_FALSE(GetBacklightsForcedOff()); | 527 EXPECT_FALSE(GetBacklightsForcedOff()); |
| 528 EXPECT_TRUE(shell_delegate_->IsTouchscreenEnabledInPrefs(true)); | 528 EXPECT_TRUE(shell_delegate_->IsTouchscreenEnabledInPrefs(true)); |
| 529 } | 529 } |
| 530 | 530 |
| 531 // Tests that when backlights get forced off due to tablet power button, media |
| 532 // sessions should be suspended. |
| 533 TEST_F(TabletPowerButtonControllerTest, SuspendMediaSessions) { |
| 534 ASSERT_FALSE(shell_delegate_->media_sessions_suspended()); |
| 535 PressPowerButton(); |
| 536 ReleasePowerButton(); |
| 537 ASSERT_TRUE(GetBacklightsForcedOff()); |
| 538 EXPECT_TRUE(shell_delegate_->media_sessions_suspended()); |
| 539 } |
| 540 |
| 531 } // namespace test | 541 } // namespace test |
| 532 } // namespace ash | 542 } // namespace ash |
| OLD | NEW |