| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <vector> | 5 #include <vector> | 
| 6 | 6 | 
| 7 #include "content/renderer/media/audio_device_factory.h" | 7 #include "content/renderer/media/audio_device_factory.h" | 
| 8 #include "content/renderer/media/audio_message_filter.h" | 8 #include "content/renderer/media/audio_message_filter.h" | 
| 9 #include "content/renderer/media/media_stream_audio_renderer.h" | 9 #include "content/renderer/media/media_stream_audio_renderer.h" | 
| 10 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.
     h" | 10 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.
     h" | 
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 80 class WebRtcAudioRendererTest : public testing::Test { | 80 class WebRtcAudioRendererTest : public testing::Test { | 
| 81  protected: | 81  protected: | 
| 82   WebRtcAudioRendererTest() | 82   WebRtcAudioRendererTest() | 
| 83       : message_loop_(new base::MessageLoopForIO), | 83       : message_loop_(new base::MessageLoopForIO), | 
| 84         mock_ipc_(new MockAudioOutputIPC()), | 84         mock_ipc_(new MockAudioOutputIPC()), | 
| 85         mock_output_device_(new FakeAudioOutputDevice( | 85         mock_output_device_(new FakeAudioOutputDevice( | 
| 86             scoped_ptr<media::AudioOutputIPC>(mock_ipc_), | 86             scoped_ptr<media::AudioOutputIPC>(mock_ipc_), | 
| 87             message_loop_->message_loop_proxy())), | 87             message_loop_->message_loop_proxy())), | 
| 88         factory_(new MockAudioDeviceFactory()), | 88         factory_(new MockAudioDeviceFactory()), | 
| 89         source_(new MockAudioRendererSource()), | 89         source_(new MockAudioRendererSource()), | 
| 90         stream_(new talk_base::RefCountedObject<MockMediaStream>("label")), | 90         stream_(new rtc::RefCountedObject<MockMediaStream>("label")), | 
| 91         renderer_(new WebRtcAudioRenderer(stream_, 1, 1, 1, 44100, 441)) { | 91         renderer_(new WebRtcAudioRenderer(stream_, 1, 1, 1, 44100, 441)) { | 
| 92     EXPECT_CALL(*factory_.get(), CreateOutputDevice(1)) | 92     EXPECT_CALL(*factory_.get(), CreateOutputDevice(1)) | 
| 93         .WillOnce(Return(mock_output_device_)); | 93         .WillOnce(Return(mock_output_device_)); | 
| 94     EXPECT_CALL(*mock_output_device_, Start()); | 94     EXPECT_CALL(*mock_output_device_, Start()); | 
| 95     EXPECT_TRUE(renderer_->Initialize(source_.get())); | 95     EXPECT_TRUE(renderer_->Initialize(source_.get())); | 
| 96     renderer_proxy_ = renderer_->CreateSharedAudioRendererProxy(stream_); | 96     renderer_proxy_ = renderer_->CreateSharedAudioRendererProxy(stream_); | 
| 97   } | 97   } | 
| 98 | 98 | 
| 99   // Used to construct |mock_output_device_|. | 99   // Used to construct |mock_output_device_|. | 
| 100   scoped_ptr<base::MessageLoopForIO> message_loop_; | 100   scoped_ptr<base::MessageLoopForIO> message_loop_; | 
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 145     } else { | 145     } else { | 
| 146       // When the last proxy is stopped, the sink will stop. | 146       // When the last proxy is stopped, the sink will stop. | 
| 147       EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); | 147       EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); | 
| 148       EXPECT_CALL(*mock_output_device_, Stop()); | 148       EXPECT_CALL(*mock_output_device_, Stop()); | 
| 149     } | 149     } | 
| 150     renderer_proxies_[i]->Stop(); | 150     renderer_proxies_[i]->Stop(); | 
| 151   } | 151   } | 
| 152 } | 152 } | 
| 153 | 153 | 
| 154 }  // namespace content | 154 }  // namespace content | 
| OLD | NEW | 
|---|