Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: content/browser/media/session/mock_media_session_player_observer.h

Issue 2526533002: Allow MediaSession in iframes to be routed (Closed)
Patch Set: nits Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <vector> 6 #include <vector>
7 7
8 #include "content/browser/media/session/media_session_player_observer.h" 8 #include "content/browser/media/session/media_session_player_observer.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 // MockMediaSessionPlayerObserver is a mock implementation of 12 // MockMediaSessionPlayerObserver is a mock implementation of
13 // MediaSessionPlayerObserver to be used in tests. 13 // MediaSessionPlayerObserver to be used in tests.
14 class MockMediaSessionPlayerObserver : public MediaSessionPlayerObserver { 14 class MockMediaSessionPlayerObserver : public MediaSessionPlayerObserver {
15 public: 15 public:
16 MockMediaSessionPlayerObserver(); 16 MockMediaSessionPlayerObserver();
17 ~MockMediaSessionPlayerObserver() override; 17 ~MockMediaSessionPlayerObserver() override;
18 18
19 // Implements MediaSessionPlayerObserver. 19 // Implements MediaSessionPlayerObserver.
20 void OnSuspend(int player_id) override; 20 void OnSuspend(int player_id) override;
21 void OnResume(int player_id) override; 21 void OnResume(int player_id) override;
22 void OnSetVolumeMultiplier(int player_id, double volume_multiplier) override; 22 void OnSetVolumeMultiplier(int player_id, double volume_multiplier) override;
23 RenderFrameHost* GetRenderFrameHost() const override;
23 24
24 // Simulate that a new player started. 25 // Simulate that a new player started.
25 // Returns the player_id. 26 // Returns the player_id.
26 int StartNewPlayer(); 27 int StartNewPlayer();
27 28
28 // Returns whether |player_id| is playing. 29 // Returns whether |player_id| is playing.
29 bool IsPlaying(size_t player_id); 30 bool IsPlaying(size_t player_id);
30 31
31 // Returns the volume multiplier of |player_id|. 32 // Returns the volume multiplier of |player_id|.
32 double GetVolumeMultiplier(size_t player_id); 33 double GetVolumeMultiplier(size_t player_id);
(...skipping 16 matching lines...) Expand all
49 50
50 // Basic representation of the players. The position in the vector is the 51 // Basic representation of the players. The position in the vector is the
51 // player_id. The value of the vector is the playing status and volume. 52 // player_id. The value of the vector is the playing status and volume.
52 std::vector<MockPlayer> players_; 53 std::vector<MockPlayer> players_;
53 54
54 int received_resume_calls_ = 0; 55 int received_resume_calls_ = 0;
55 int received_suspend_calls_ = 0; 56 int received_suspend_calls_ = 0;
56 }; 57 };
57 58
58 } // namespace content 59 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698