| OLD | NEW |
| 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 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "content/browser/renderer_host/media/mock_media_observer.h" | 15 #include "content/browser/renderer_host/media/mock_media_observer.h" |
| 16 #include "content/public/renderer/content_renderer_client.h" | 16 #include "content/public/renderer/content_renderer_client.h" |
| 17 #include "media/base/channel_layout.h" | 17 #include "media/base/channel_layout.h" |
| 18 #include "ipc/ipc_channel.h" | 18 #include "ipc/ipc_channel.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "third_party/webrtc/common_types.h" | 20 #include "third_party/webrtc/common_types.h" |
| 21 | 21 |
| 22 class AudioDeviceFactoryInterface; |
| 22 class AudioInputRendererHost; | 23 class AudioInputRendererHost; |
| 23 class AudioRendererHost; | 24 class AudioRendererHost; |
| 24 class RenderThreadImpl; | 25 class RenderThreadImpl; |
| 25 class WebRTCMockRenderProcess; | 26 class WebRTCMockRenderProcess; |
| 26 | 27 |
| 27 namespace base { | 28 namespace base { |
| 28 namespace win { | 29 namespace win { |
| 29 class ScopedCOMInitializer; | 30 class ScopedCOMInitializer; |
| 30 } | 31 } |
| 31 } | 32 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // Posts a final task to the IO message loop and waits for completion. | 154 // Posts a final task to the IO message loop and waits for completion. |
| 154 void WaitForIOThreadCompletion(); | 155 void WaitForIOThreadCompletion(); |
| 155 void WaitForAudioManagerCompletion(); | 156 void WaitForAudioManagerCompletion(); |
| 156 void WaitForMessageLoopCompletion(base::MessageLoopProxy* loop); | 157 void WaitForMessageLoopCompletion(base::MessageLoopProxy* loop); |
| 157 | 158 |
| 158 // Convenience getter for gmock. | 159 // Convenience getter for gmock. |
| 159 MockMediaObserver& media_observer() const { | 160 MockMediaObserver& media_observer() const { |
| 160 return *media_observer_.get(); | 161 return *media_observer_.get(); |
| 161 } | 162 } |
| 162 | 163 |
| 164 // Convenience getter for the audio device factory. |
| 165 AudioDeviceFactoryInterface* audio_device_factory() const { |
| 166 return audio_device_factory_.get(); |
| 167 } |
| 168 |
| 163 std::string GetTestDataPath(const FilePath::StringType& file_name); | 169 std::string GetTestDataPath(const FilePath::StringType& file_name); |
| 164 | 170 |
| 165 scoped_ptr<ReplaceContentClientRenderer> saved_content_renderer_; | 171 scoped_ptr<ReplaceContentClientRenderer> saved_content_renderer_; |
| 166 MessageLoopForUI message_loop_; | 172 MessageLoopForUI message_loop_; |
| 167 content::ContentRendererClient content_renderer_client_; | 173 content::ContentRendererClient content_renderer_client_; |
| 168 RenderThreadImpl* render_thread_; // Owned by mock_process_. | 174 RenderThreadImpl* render_thread_; // Owned by mock_process_. |
| 169 scoped_ptr<WebRTCMockRenderProcess> mock_process_; | 175 scoped_ptr<WebRTCMockRenderProcess> mock_process_; |
| 170 scoped_ptr<MockMediaObserver> media_observer_; | 176 scoped_ptr<MockMediaObserver> media_observer_; |
| 171 scoped_ptr<media_stream::MediaStreamManager> media_stream_manager_; | 177 scoped_ptr<media_stream::MediaStreamManager> media_stream_manager_; |
| 172 scoped_ptr<media::AudioManager> audio_manager_; | 178 scoped_ptr<media::AudioManager> audio_manager_; |
| 173 scoped_ptr<net::URLRequestContext> test_request_context_; | 179 scoped_ptr<net::URLRequestContext> test_request_context_; |
| 174 scoped_ptr<content::ResourceContext> resource_context_; | 180 scoped_ptr<content::ResourceContext> resource_context_; |
| 175 scoped_ptr<IPC::Channel> channel_; | 181 scoped_ptr<IPC::Channel> channel_; |
| 182 scoped_ptr<AudioDeviceFactoryInterface> audio_device_factory_; |
| 176 scoped_refptr<AudioRendererHost> audio_render_host_; | 183 scoped_refptr<AudioRendererHost> audio_render_host_; |
| 177 scoped_refptr<AudioInputRendererHost> audio_input_renderer_host_; | 184 scoped_refptr<AudioInputRendererHost> audio_input_renderer_host_; |
| 178 | 185 |
| 179 AudioUtilInterface* audio_util_callback_; // Weak reference. | 186 AudioUtilInterface* audio_util_callback_; // Weak reference. |
| 180 | 187 |
| 181 // Initialized on the main test thread that we mark as the UI thread. | 188 // Initialized on the main test thread that we mark as the UI thread. |
| 182 scoped_ptr<content::TestBrowserThread> ui_thread_; | 189 scoped_ptr<content::TestBrowserThread> ui_thread_; |
| 183 // Initialized on our IO thread to satisfy BrowserThread::IO checks. | 190 // Initialized on our IO thread to satisfy BrowserThread::IO checks. |
| 184 scoped_ptr<content::TestBrowserThread> io_thread_; | 191 scoped_ptr<content::TestBrowserThread> io_thread_; |
| 185 // COM initialization on the IO thread for Windows. | 192 // COM initialization on the IO thread for Windows. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 203 virtual ~WebRTCTransportImpl(); | 210 virtual ~WebRTCTransportImpl(); |
| 204 | 211 |
| 205 virtual int SendPacket(int channel, const void* data, int len) OVERRIDE; | 212 virtual int SendPacket(int channel, const void* data, int len) OVERRIDE; |
| 206 virtual int SendRTCPPacket(int channel, const void* data, int len) OVERRIDE; | 213 virtual int SendRTCPPacket(int channel, const void* data, int len) OVERRIDE; |
| 207 | 214 |
| 208 private: | 215 private: |
| 209 webrtc::VoENetwork* network_; | 216 webrtc::VoENetwork* network_; |
| 210 }; | 217 }; |
| 211 | 218 |
| 212 #endif // CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_ | 219 #endif // CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_ |
| OLD | NEW |