fixup! Fix for Geolocation webTCT failures
[platform/framework/web/chromium-efl.git] / ash / test_media_client.h
1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_TEST_MEDIA_CLIENT_H_
6 #define ASH_TEST_MEDIA_CLIENT_H_
7
8 #include "ash/public/cpp/media_client.h"
9
10 namespace ash {
11
12 // Implement MediaClient mojo interface to simulate chrome behavior in tests.
13 // This breaks the ash/chrome dependency to allow testing ash code in isolation.
14 class TestMediaClient : public MediaClient {
15  public:
16   TestMediaClient();
17
18   TestMediaClient(const TestMediaClient&) = delete;
19   TestMediaClient& operator=(const TestMediaClient&) = delete;
20
21   ~TestMediaClient() override;
22
23   // MediaClient:
24   void HandleMediaNextTrack() override;
25   void HandleMediaPlayPause() override;
26   void HandleMediaPlay() override;
27   void HandleMediaPause() override;
28   void HandleMediaStop() override;
29   void HandleMediaPrevTrack() override;
30   void HandleMediaSeekBackward() override;
31   void HandleMediaSeekForward() override;
32   void RequestCaptureState() override;
33   void SuspendMediaSessions() override;
34
35   int handle_media_next_track_count() const {
36     return handle_media_next_track_count_;
37   }
38   int handle_media_play_pause_count() const {
39     return handle_media_play_pause_count_;
40   }
41   int handle_media_play_count() const { return handle_media_play_count_; }
42   int handle_media_pause_count() const { return handle_media_pause_count_; }
43   int handle_media_stop_count() const { return handle_media_pause_count_; }
44   int handle_media_prev_track_count() const {
45     return handle_media_prev_track_count_;
46   }
47   int handle_media_seek_backward_count() const {
48     return handle_media_seek_backward_count_;
49   }
50   int handle_media_seek_forward_count() const {
51     return handle_media_seek_forward_count_;
52   }
53   bool media_sessions_suspended() const { return media_sessions_suspended_; }
54
55  private:
56   int handle_media_next_track_count_ = 0;
57   int handle_media_play_pause_count_ = 0;
58   int handle_media_play_count_ = 0;
59   int handle_media_pause_count_ = 0;
60   int handle_media_stop_count_ = 0;
61   int handle_media_prev_track_count_ = 0;
62   int handle_media_seek_backward_count_ = 0;
63   int handle_media_seek_forward_count_ = 0;
64   bool media_sessions_suspended_ = false;
65 };
66
67 }  // namespace ash
68
69 #endif  // ASH_TEST_MEDIA_CLIENT_H_