| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/environment.h" | 6 #include "base/environment.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (!manager->Init()) | 56 if (!manager->Init()) |
| 57 manager.reset(); | 57 manager.reset(); |
| 58 return std::move(manager); | 58 return std::move(manager); |
| 59 } | 59 } |
| 60 }; | 60 }; |
| 61 #endif // defined(USE_PULSEAUDIO) | 61 #endif // defined(USE_PULSEAUDIO) |
| 62 | 62 |
| 63 template <> | 63 template <> |
| 64 struct TestAudioManagerFactory<std::nullptr_t> { | 64 struct TestAudioManagerFactory<std::nullptr_t> { |
| 65 static ScopedAudioManagerPtr Create(AudioLogFactory* audio_log_factory) { | 65 static ScopedAudioManagerPtr Create(AudioLogFactory* audio_log_factory) { |
| 66 return AudioManager::Create(base::ThreadTaskRunnerHandle::Get(), | 66 return AudioManager::CreateForTesting(base::ThreadTaskRunnerHandle::Get()); |
| 67 base::ThreadTaskRunnerHandle::Get(), nullptr, | |
| 68 audio_log_factory); | |
| 69 } | 67 } |
| 70 }; | 68 }; |
| 71 } // namespace | 69 } // namespace |
| 72 | 70 |
| 73 // Test fixture which allows us to override the default enumeration API on | 71 // Test fixture which allows us to override the default enumeration API on |
| 74 // Windows. | 72 // Windows. |
| 75 class AudioManagerTest : public ::testing::Test { | 73 class AudioManagerTest : public ::testing::Test { |
| 76 public: | 74 public: |
| 77 void HandleDefaultDeviceIDsTest() { | 75 void HandleDefaultDeviceIDsTest() { |
| 78 AudioParameters params(AudioParameters::AUDIO_PCM_LOW_LATENCY, | 76 AudioParameters params(AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 DVLOG(2) << it->unique_id << " matches with " << output_device_id; | 420 DVLOG(2) << it->unique_id << " matches with " << output_device_id; |
| 423 found_an_associated_device = true; | 421 found_an_associated_device = true; |
| 424 } | 422 } |
| 425 } | 423 } |
| 426 | 424 |
| 427 EXPECT_TRUE(found_an_associated_device); | 425 EXPECT_TRUE(found_an_associated_device); |
| 428 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 426 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 429 } | 427 } |
| 430 | 428 |
| 431 } // namespace media | 429 } // namespace media |
| OLD | NEW |