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.
5 #ifndef ASH_TEST_MEDIA_CLIENT_H_
6 #define ASH_TEST_MEDIA_CLIENT_H_
8 #include "ash/public/cpp/media_client.h"
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 {
18 TestMediaClient(const TestMediaClient&) = delete;
19 TestMediaClient& operator=(const TestMediaClient&) = delete;
21 ~TestMediaClient() override;
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;
35 int handle_media_next_track_count() const {
36 return handle_media_next_track_count_;
38 int handle_media_play_pause_count() const {
39 return handle_media_play_pause_count_;
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_;
47 int handle_media_seek_backward_count() const {
48 return handle_media_seek_backward_count_;
50 int handle_media_seek_forward_count() const {
51 return handle_media_seek_forward_count_;
53 bool media_sessions_suspended() const { return media_sessions_suspended_; }
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;
69 #endif // ASH_TEST_MEDIA_CLIENT_H_