| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 test_->InitializeIOThread(thread_name); | 127 test_->InitializeIOThread(thread_name); |
| 128 } | 128 } |
| 129 void UninitializeIOThread() { test_->UninitializeIOThread(); } | 129 void UninitializeIOThread() { test_->UninitializeIOThread(); } |
| 130 protected: | 130 protected: |
| 131 WebRTCAudioDeviceTest* test_; | 131 WebRTCAudioDeviceTest* test_; |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 WebRTCAudioDeviceTest(); | 134 WebRTCAudioDeviceTest(); |
| 135 virtual ~WebRTCAudioDeviceTest(); | 135 virtual ~WebRTCAudioDeviceTest(); |
| 136 | 136 |
| 137 virtual void SetUp(); | 137 virtual void SetUp() OVERRIDE; |
| 138 virtual void TearDown(); | 138 virtual void TearDown() OVERRIDE; |
| 139 | 139 |
| 140 // Sends an IPC message to the IO thread channel. | 140 // Sends an IPC message to the IO thread channel. |
| 141 bool Send(IPC::Message* message); | 141 bool Send(IPC::Message* message); |
| 142 | 142 |
| 143 void set_audio_util_callback(AudioUtilInterface* callback) { | 143 void set_audio_util_callback(AudioUtilInterface* callback) { |
| 144 audio_util_callback_ = callback; | 144 audio_util_callback_ = callback; |
| 145 } | 145 } |
| 146 | 146 |
| 147 protected: | 147 protected: |
| 148 void InitializeIOThread(const char* thread_name); | 148 void InitializeIOThread(const char* thread_name); |
| 149 void UninitializeIOThread(); | 149 void UninitializeIOThread(); |
| 150 void CreateChannel(const char* name, | 150 void CreateChannel(const char* name, |
| 151 content::ResourceContext* resource_context); | 151 content::ResourceContext* resource_context); |
| 152 void DestroyChannel(); | 152 void DestroyChannel(); |
| 153 | 153 |
| 154 void OnGetHardwareSampleRate(double* sample_rate); | 154 void OnGetHardwareSampleRate(double* sample_rate); |
| 155 void OnGetHardwareInputSampleRate(double* sample_rate); | 155 void OnGetHardwareInputSampleRate(double* sample_rate); |
| 156 | 156 |
| 157 // IPC::Channel::Listener implementation. | 157 // IPC::Channel::Listener implementation. |
| 158 virtual bool OnMessageReceived(const IPC::Message& message); | 158 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 159 | 159 |
| 160 // Posts a final task to the IO message loop and waits for completion. | 160 // Posts a final task to the IO message loop and waits for completion. |
| 161 void WaitForIOThreadCompletion(); | 161 void WaitForIOThreadCompletion(); |
| 162 | 162 |
| 163 // Convenience getter for gmock. | 163 // Convenience getter for gmock. |
| 164 MockMediaObserver& media_observer() const { | 164 MockMediaObserver& media_observer() const { |
| 165 return *media_observer_.get(); | 165 return *media_observer_.get(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 std::string GetTestDataPath(const FilePath::StringType& file_name); | 168 std::string GetTestDataPath(const FilePath::StringType& file_name); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 // A very basic implementation of webrtc::Transport that acts as a transport | 194 // A very basic implementation of webrtc::Transport that acts as a transport |
| 195 // but just forwards all calls to a local webrtc::VoENetwork implementation. | 195 // but just forwards all calls to a local webrtc::VoENetwork implementation. |
| 196 // Ownership of the VoENetwork object lies outside the class. | 196 // Ownership of the VoENetwork object lies outside the class. |
| 197 class WebRTCTransportImpl : public webrtc::Transport { | 197 class WebRTCTransportImpl : public webrtc::Transport { |
| 198 public: | 198 public: |
| 199 explicit WebRTCTransportImpl(webrtc::VoENetwork* network); | 199 explicit WebRTCTransportImpl(webrtc::VoENetwork* network); |
| 200 virtual ~WebRTCTransportImpl(); | 200 virtual ~WebRTCTransportImpl(); |
| 201 | 201 |
| 202 virtual int SendPacket(int channel, const void* data, int len); | 202 virtual int SendPacket(int channel, const void* data, int len) OVERRIDE; |
| 203 virtual int SendRTCPPacket(int channel, const void* data, int len); | 203 virtual int SendRTCPPacket(int channel, const void* data, int len) OVERRIDE; |
| 204 | 204 |
| 205 private: | 205 private: |
| 206 webrtc::VoENetwork* network_; | 206 webrtc::VoENetwork* network_; |
| 207 }; | 207 }; |
| 208 | 208 |
| 209 #endif // CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_ | 209 #endif // CONTENT_TEST_WEBRTC_AUDIO_DEVICE_TEST_H_ |
| OLD | NEW |