power_button_screenshot_controller_test_api.cc 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/system/power/power_button_screenshot_controller_test_api.h"
  5. #include "ash/system/power/power_button_screenshot_controller.h"
  6. namespace ash {
  7. PowerButtonScreenshotControllerTestApi::PowerButtonScreenshotControllerTestApi(
  8. PowerButtonScreenshotController* controller)
  9. : controller_(controller) {
  10. DCHECK(controller_);
  11. }
  12. PowerButtonScreenshotControllerTestApi::
  13. ~PowerButtonScreenshotControllerTestApi() = default;
  14. bool PowerButtonScreenshotControllerTestApi::TriggerVolumeDownTimer() {
  15. if (!controller_->volume_down_timer_.IsRunning())
  16. return false;
  17. controller_->volume_down_timer_.FireNow();
  18. return true;
  19. }
  20. bool PowerButtonScreenshotControllerTestApi::TriggerVolumeUpTimer() {
  21. if (!controller_->volume_up_timer_.IsRunning())
  22. return false;
  23. controller_->volume_up_timer_.FireNow();
  24. return true;
  25. }
  26. } // namespace ash