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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done); | 445 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done); |
446 } | 446 } |
447 | 447 |
448 protected: | 448 protected: |
449 // MediaStreamManager uses a DestructionObserver, so it must outlive the | 449 // MediaStreamManager uses a DestructionObserver, so it must outlive the |
450 // TestBrowserThreadBundle. | 450 // TestBrowserThreadBundle. |
451 std::unique_ptr<MediaStreamManager> media_stream_manager_; | 451 std::unique_ptr<MediaStreamManager> media_stream_manager_; |
452 std::unique_ptr<TestBrowserThreadBundle> thread_bundle_; | 452 std::unique_ptr<TestBrowserThreadBundle> thread_bundle_; |
453 std::unique_ptr<AudioManagerThread> audio_thread_; | 453 std::unique_ptr<AudioManagerThread> audio_thread_; |
454 media::ScopedAudioManagerPtr audio_manager_; | 454 media::ScopedAudioManagerPtr audio_manager_; |
455 std::unique_ptr<media::AudioSystem> audio_system_; | 455 media::AudioSystem::UniquePtr audio_system_; |
456 StrictMock<MockAudioMirroringManager> mirroring_manager_; | 456 StrictMock<MockAudioMirroringManager> mirroring_manager_; |
457 StrictMock<MockEventHandler> event_handler_; | 457 StrictMock<MockEventHandler> event_handler_; |
458 StrictMock<MockObserver> media_observer_; | 458 StrictMock<MockObserver> media_observer_; |
459 media::FakeAudioLogFactory log_factory_; | 459 media::FakeAudioLogFactory log_factory_; |
460 | 460 |
461 private: | 461 private: |
462 void SyncWithAllThreads() { | 462 void SyncWithAllThreads() { |
463 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 463 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
464 // New tasks might be posted while we are syncing, but in every iteration at | 464 // New tasks might be posted while we are syncing, but in every iteration at |
465 // least one task will be run. 20 iterations should be enough for our code. | 465 // least one task will be run. 20 iterations should be enough for our code. |
(...skipping 107 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 |