blob: 862d7be6abf1ac48ea109ce16a72d924aaf18648 [file] [log] [blame]
Avi Drissman8ba1bad2022-09-13 19:22:361// Copyright 2022 The Chromium Authors
yjliu9edcefd2022-01-25 02:00:332// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef COMPONENTS_EXO_SURFACE_TEST_UTIL_H_
6#define COMPONENTS_EXO_SURFACE_TEST_UTIL_H_
7
8#include "components/exo/surface_observer.h"
9#include "testing/gmock/include/gmock/gmock.h"
10
11namespace exo {
12
13class SurfaceObserverForTest : public SurfaceObserver {
14 public:
15 SurfaceObserverForTest();
16 SurfaceObserverForTest(const SurfaceObserverForTest&) = delete;
17 SurfaceObserverForTest& operator=(const SurfaceObserverForTest&) = delete;
Arthur Eubanksb34721e2022-08-24 17:47:2018 ~SurfaceObserverForTest() override;
yjliu9edcefd2022-01-25 02:00:3319
20 // SurfaceObserver overrides
21 void OnSurfaceDestroying(Surface* surface) override {}
22
23 void OnWindowOcclusionChanged(Surface* surface) override {
24 num_occlusion_changes_++;
25 }
26
27 int num_occlusion_changes() const { return num_occlusion_changes_; }
28
29 MOCK_METHOD(void, ThrottleFrameRate, (bool on), (override));
30
31 private:
32 int num_occlusion_changes_ = 0;
33};
34
35} // namespace exo
36
37#endif // COMPONENTS_EXO_SURFACE_TEST_UTIL_H_