power_event_observer_test_api.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2018 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. #ifndef ASH_SYSTEM_POWER_POWER_EVENT_OBSERVER_TEST_API_H_
  5. #define ASH_SYSTEM_POWER_POWER_EVENT_OBSERVER_TEST_API_H_
  6. namespace ui {
  7. class Compositor;
  8. }
  9. namespace ash {
  10. class PowerEventObserver;
  11. class PowerEventObserverTestApi {
  12. public:
  13. explicit PowerEventObserverTestApi(PowerEventObserver* power_event_observer);
  14. PowerEventObserverTestApi(const PowerEventObserverTestApi&) = delete;
  15. PowerEventObserverTestApi& operator=(const PowerEventObserverTestApi&) =
  16. delete;
  17. ~PowerEventObserverTestApi();
  18. void CompositingDidCommit(ui::Compositor* compositor);
  19. void CompositingStarted(ui::Compositor* compositor);
  20. void CompositingEnded(ui::Compositor* compositor);
  21. // Same as calling CompositingDidCommit, CompositingStarted and
  22. // CompositingEnded in sequence.
  23. void CompositeFrame(ui::Compositor* compositor);
  24. bool SimulateCompositorsReadyForSuspend();
  25. bool TrackingLockOnSuspendUsage() const;
  26. private:
  27. PowerEventObserver* power_event_observer_;
  28. };
  29. } // namespace ash
  30. #endif // ASH_SYSTEM_POWER_POWER_EVENT_OBSERVER_TEST_API_H_