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

Side by Side Diff: content/test/webrtc_audio_device_test.h

Issue 10662005: Use IPC::Sender and IPC::Listener in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « content/test/mock_render_thread.cc ('k') | content/test/webrtc_audio_device_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_ 5 #ifndef CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_
6 #define CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_ 6 #define CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 virtual int GetAudioHardwareSampleRate() = 0; 115 virtual int GetAudioHardwareSampleRate() = 0;
116 virtual int GetAudioInputHardwareSampleRate( 116 virtual int GetAudioInputHardwareSampleRate(
117 const std::string& device_id) = 0; 117 const std::string& device_id) = 0;
118 virtual ChannelLayout GetAudioInputHardwareChannelLayout( 118 virtual ChannelLayout GetAudioInputHardwareChannelLayout(
119 const std::string& device_id) = 0; 119 const std::string& device_id) = 0;
120 }; 120 };
121 121
122 // Implemented and defined in the cc file. 122 // Implemented and defined in the cc file.
123 class ReplaceContentClientRenderer; 123 class ReplaceContentClientRenderer;
124 124
125 class WebRTCAudioDeviceTest 125 class WebRTCAudioDeviceTest : public ::testing::Test, public IPC::Listener {
126 : public ::testing::Test,
127 public IPC::Channel::Listener {
128 public: 126 public:
129 WebRTCAudioDeviceTest(); 127 WebRTCAudioDeviceTest();
130 virtual ~WebRTCAudioDeviceTest(); 128 virtual ~WebRTCAudioDeviceTest();
131 129
132 virtual void SetUp() OVERRIDE; 130 virtual void SetUp() OVERRIDE;
133 virtual void TearDown() OVERRIDE; 131 virtual void TearDown() OVERRIDE;
134 132
135 // Sends an IPC message to the IO thread channel. 133 // Sends an IPC message to the IO thread channel.
136 bool Send(IPC::Message* message); 134 bool Send(IPC::Message* message);
137 135
138 void SetAudioUtilCallback(AudioUtilInterface* callback); 136 void SetAudioUtilCallback(AudioUtilInterface* callback);
139 137
140 protected: 138 protected:
141 void InitializeIOThread(const char* thread_name); 139 void InitializeIOThread(const char* thread_name);
142 void UninitializeIOThread(); 140 void UninitializeIOThread();
143 void CreateChannel(const char* name); 141 void CreateChannel(const char* name);
144 void DestroyChannel(); 142 void DestroyChannel();
145 143
146 void OnGetHardwareSampleRate(int* sample_rate); 144 void OnGetHardwareSampleRate(int* sample_rate);
147 void OnGetHardwareInputSampleRate(int* sample_rate); 145 void OnGetHardwareInputSampleRate(int* sample_rate);
148 void OnGetHardwareInputChannelLayout(ChannelLayout* channels); 146 void OnGetHardwareInputChannelLayout(ChannelLayout* channels);
149 147
150 // IPC::Channel::Listener implementation. 148 // IPC::Listener implementation.
151 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 149 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
152 150
153 // Posts a final task to the IO message loop and waits for completion. 151 // Posts a final task to the IO message loop and waits for completion.
154 void WaitForIOThreadCompletion(); 152 void WaitForIOThreadCompletion();
155 void WaitForAudioManagerCompletion(); 153 void WaitForAudioManagerCompletion();
156 void WaitForMessageLoopCompletion(base::MessageLoopProxy* loop); 154 void WaitForMessageLoopCompletion(base::MessageLoopProxy* loop);
157 155
158 // Convenience getter for gmock. 156 // Convenience getter for gmock.
159 MockMediaObserver& media_observer() const { 157 MockMediaObserver& media_observer() const {
160 return *media_observer_.get(); 158 return *media_observer_.get();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 virtual ~WebRTCTransportImpl(); 201 virtual ~WebRTCTransportImpl();
204 202
205 virtual int SendPacket(int channel, const void* data, int len) OVERRIDE; 203 virtual int SendPacket(int channel, const void* data, int len) OVERRIDE;
206 virtual int SendRTCPPacket(int channel, const void* data, int len) OVERRIDE; 204 virtual int SendRTCPPacket(int channel, const void* data, int len) OVERRIDE;
207 205
208 private: 206 private:
209 webrtc::VoENetwork* network_; 207 webrtc::VoENetwork* network_;
210 }; 208 };
211 209
212 #endif // CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_ 210 #endif // CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_
OLDNEW
« no previous file with comments | « content/test/mock_render_thread.cc ('k') | content/test/webrtc_audio_device_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698