| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/renderer_host/media/audio_output_delegate_impl.h" | 5 #include "content/browser/renderer_host/media/audio_output_delegate_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // approximate the real conditions of AudioOutputDelegate well. | 111 // approximate the real conditions of AudioOutputDelegate well. |
| 112 thread_bundle_ = base::MakeUnique<TestBrowserThreadBundle>( | 112 thread_bundle_ = base::MakeUnique<TestBrowserThreadBundle>( |
| 113 TestBrowserThreadBundle::Options::REAL_IO_THREAD); | 113 TestBrowserThreadBundle::Options::REAL_IO_THREAD); |
| 114 audio_thread_ = base::MakeUnique<AudioManagerThread>(); | 114 audio_thread_ = base::MakeUnique<AudioManagerThread>(); |
| 115 | 115 |
| 116 audio_manager_.reset(new media::FakeAudioManager( | 116 audio_manager_.reset(new media::FakeAudioManager( |
| 117 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), | 117 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), |
| 118 &log_factory_)); | 118 &log_factory_)); |
| 119 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 119 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
| 120 media_stream_manager_ = | 120 media_stream_manager_ = |
| 121 base::MakeUnique<MediaStreamManager>(audio_system_.get()); | 121 MediaStreamManager::CreateWithDefaults(audio_system_.get()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 // Test bodies are here, so that we can run them on the IO thread. | 124 // Test bodies are here, so that we can run them on the IO thread. |
| 125 void CreateTest(base::Closure done) { | 125 void CreateTest(base::Closure done) { |
| 126 EXPECT_CALL(media_observer_, | 126 EXPECT_CALL(media_observer_, |
| 127 OnCreatingAudioStream(kRenderProcessId, kRenderFrameId)); | 127 OnCreatingAudioStream(kRenderProcessId, kRenderFrameId)); |
| 128 EXPECT_CALL(event_handler_, | 128 EXPECT_CALL(event_handler_, |
| 129 OnStreamCreated(kStreamId, NotNull(), NotNull())); | 129 OnStreamCreated(kStreamId, NotNull(), NotNull())); |
| 130 EXPECT_CALL(mirroring_manager_, | 130 EXPECT_CALL(mirroring_manager_, |
| 131 AddDiverter(kRenderProcessId, kRenderFrameId, NotNull())); | 131 AddDiverter(kRenderProcessId, kRenderFrameId, NotNull())); |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 TEST_F(AudioOutputDelegateTest, ErrorAndDestroy) { | 573 TEST_F(AudioOutputDelegateTest, ErrorAndDestroy) { |
| 574 base::RunLoop l; | 574 base::RunLoop l; |
| 575 BrowserThread::PostTask( | 575 BrowserThread::PostTask( |
| 576 BrowserThread::IO, FROM_HERE, | 576 BrowserThread::IO, FROM_HERE, |
| 577 base::Bind(&AudioOutputDelegateTest::PlayAndDestroyTest, | 577 base::Bind(&AudioOutputDelegateTest::PlayAndDestroyTest, |
| 578 base::Unretained(this), l.QuitClosure())); | 578 base::Unretained(this), l.QuitClosure())); |
| 579 l.Run(); | 579 l.Run(); |
| 580 } | 580 } |
| 581 | 581 |
| 582 } // namespace content | 582 } // namespace content |
| OLD | NEW |