summaryrefslogtreecommitdiffstats
path: root/content/test
diff options
context:
space:
mode:
Diffstat (limited to 'content/test')
-rw-r--r--content/test/mock_resource_context.cc10
-rw-r--r--content/test/mock_resource_context.h6
-rw-r--r--content/test/webrtc_audio_device_test.cc3
3 files changed, 16 insertions, 3 deletions
diff --git a/content/test/mock_resource_context.cc b/content/test/mock_resource_context.cc
index ee9a6f1..ec64c69 100644
--- a/content/test/mock_resource_context.cc
+++ b/content/test/mock_resource_context.cc
@@ -10,11 +10,13 @@
namespace content {
MockResourceContext::MockResourceContext()
- : test_request_context_(new TestURLRequestContext) {
+ : test_request_context_(new TestURLRequestContext),
+ media_observer_(NULL) {
}
MockResourceContext::MockResourceContext(net::URLRequestContext* context)
- : test_request_context_(context) {
+ : test_request_context_(context),
+ media_observer_(NULL) {
}
MockResourceContext::~MockResourceContext() {}
@@ -27,4 +29,8 @@ net::URLRequestContext* MockResourceContext::GetRequestContext() {
return test_request_context_;
}
+MediaObserver* MockResourceContext::GetMediaObserver() {
+ return media_observer_;
+}
+
} // namespace content
diff --git a/content/test/mock_resource_context.h b/content/test/mock_resource_context.h
index d25bcd6..5e6d213 100644
--- a/content/test/mock_resource_context.h
+++ b/content/test/mock_resource_context.h
@@ -23,12 +23,18 @@ class MockResourceContext : public ResourceContext {
test_request_context_ = context;
}
+ void set_media_observer(MediaObserver* observer) {
+ media_observer_ = observer;
+ }
+
// ResourceContext implementation:
virtual net::HostResolver* GetHostResolver() OVERRIDE;
virtual net::URLRequestContext* GetRequestContext() OVERRIDE;
+ virtual MediaObserver* GetMediaObserver() OVERRIDE;
private:
scoped_refptr<net::URLRequestContext> test_request_context_;
+ MediaObserver* media_observer_;
DISALLOW_COPY_AND_ASSIGN(MockResourceContext);
};
diff --git a/content/test/webrtc_audio_device_test.cc b/content/test/webrtc_audio_device_test.cc
index cb37584..d13f79ca 100644
--- a/content/test/webrtc_audio_device_test.cc
+++ b/content/test/webrtc_audio_device_test.cc
@@ -170,6 +170,7 @@ void WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) {
test_request_context_ = new TestURLRequestContext();
resource_context_->set_request_context(test_request_context_.get());
media_observer_.reset(new MockMediaObserver());
+ resource_context_->set_media_observer(media_observer_.get());
// Create an IPC channel that handles incoming messages on the IO thread.
CreateChannel(thread_name);
@@ -186,7 +187,7 @@ void WebRTCAudioDeviceTest::UninitializeIOThread() {
void WebRTCAudioDeviceTest::CreateChannel(const char* name) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
audio_render_host_ = new AudioRendererHost(
- audio_manager_.get(), media_observer_.get());
+ resource_context_.get(), audio_manager_.get());
audio_render_host_->OnChannelConnected(base::GetCurrentProcId());
audio_input_renderer_host_ = new AudioInputRendererHost(