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 // Unit tests for AudioOutputAuthorizationHandler. | 5 // Unit tests for AudioOutputAuthorizationHandler. |
6 | 6 |
7 #include "content/browser/renderer_host/media/audio_output_authorization_handler
.h" | 7 #include "content/browser/renderer_host/media/audio_output_authorization_handler
.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 switches::kUseFakeDeviceForMediaStream); | 62 switches::kUseFakeDeviceForMediaStream); |
63 | 63 |
64 thread_bundle_ = base::MakeUnique<TestBrowserThreadBundle>( | 64 thread_bundle_ = base::MakeUnique<TestBrowserThreadBundle>( |
65 TestBrowserThreadBundle::Options::REAL_IO_THREAD); | 65 TestBrowserThreadBundle::Options::REAL_IO_THREAD); |
66 audio_thread_ = base::MakeUnique<AudioManagerThread>(); | 66 audio_thread_ = base::MakeUnique<AudioManagerThread>(); |
67 audio_manager_.reset(new media::FakeAudioManager( | 67 audio_manager_.reset(new media::FakeAudioManager( |
68 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), | 68 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), |
69 &log_factory_)); | 69 &log_factory_)); |
70 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 70 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
71 media_stream_manager_ = | 71 media_stream_manager_ = |
72 base::MakeUnique<MediaStreamManager>(audio_manager_.get()); | 72 base::MakeUnique<MediaStreamManager>(audio_system_.get()); |
73 // Make sure everything is done initializing: | 73 // Make sure everything is done initializing: |
74 SyncWithAllThreads(); | 74 SyncWithAllThreads(); |
75 } | 75 } |
76 | 76 |
77 ~AudioOutputAuthorizationHandlerTest() override { SyncWithAllThreads(); } | 77 ~AudioOutputAuthorizationHandlerTest() override { SyncWithAllThreads(); } |
78 | 78 |
79 protected: | 79 protected: |
80 MediaStreamManager* GetMediaStreamManager() { | 80 MediaStreamManager* GetMediaStreamManager() { |
81 return media_stream_manager_.get(); | 81 return media_stream_manager_.get(); |
82 } | 82 } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 (base::Bind(&AudioOutputAuthorizationHandler::RequestDeviceAuthorization, | 328 (base::Bind(&AudioOutputAuthorizationHandler::RequestDeviceAuthorization, |
329 base::Unretained(handler.get()), kRenderFrameId, kSessionId, | 329 base::Unretained(handler.get()), kRenderFrameId, kSessionId, |
330 std::string(), BadSecurityOrigin(), listener.Get()))); | 330 std::string(), BadSecurityOrigin(), listener.Get()))); |
331 | 331 |
332 SyncWithAllThreads(); | 332 SyncWithAllThreads(); |
333 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, handler.release()); | 333 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, handler.release()); |
334 SyncWithAllThreads(); | 334 SyncWithAllThreads(); |
335 } | 335 } |
336 | 336 |
337 } // namespace content | 337 } // namespace content |
OLD | NEW |