OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <windows.h> | 5 #include <windows.h> |
6 #include <mmsystem.h> | 6 #include <mmsystem.h> |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/base_paths.h" | 12 #include "base/base_paths.h" |
13 #include "base/memory/aligned_memory.h" | 13 #include "base/memory/aligned_memory.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/run_loop.h" |
15 #include "base/sync_socket.h" | 16 #include "base/sync_socket.h" |
16 #include "base/win/scoped_com_initializer.h" | 17 #include "base/win/scoped_com_initializer.h" |
17 #include "base/win/windows_version.h" | 18 #include "base/win/windows_version.h" |
18 #include "media/audio/audio_io.h" | 19 #include "media/audio/audio_io.h" |
19 #include "media/audio/audio_manager.h" | 20 #include "media/audio/audio_manager.h" |
20 #include "media/audio/audio_unittest_util.h" | 21 #include "media/audio/audio_unittest_util.h" |
21 #include "media/audio/mock_audio_source_callback.h" | 22 #include "media/audio/mock_audio_source_callback.h" |
22 #include "media/audio/simple_sources.h" | 23 #include "media/audio/simple_sources.h" |
23 #include "media/base/limits.h" | 24 #include "media/base/limits.h" |
24 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 HANDLE fmap_; | 145 HANDLE fmap_; |
145 char* start_; | 146 char* start_; |
146 uint32_t size_; | 147 uint32_t size_; |
147 }; | 148 }; |
148 | 149 |
149 class WinAudioTest : public ::testing::Test { | 150 class WinAudioTest : public ::testing::Test { |
150 public: | 151 public: |
151 WinAudioTest() { | 152 WinAudioTest() { |
152 audio_manager_ = | 153 audio_manager_ = |
153 AudioManager::CreateForTesting(message_loop_.task_runner()); | 154 AudioManager::CreateForTesting(message_loop_.task_runner()); |
154 message_loop_.RunUntilIdle(); | 155 base::RunLoop().RunUntilIdle(); |
155 } | 156 } |
156 ~WinAudioTest() override { | 157 ~WinAudioTest() override { |
157 audio_manager_.reset(); | 158 audio_manager_.reset(); |
158 message_loop_.RunUntilIdle(); | 159 base::RunLoop().RunUntilIdle(); |
159 } | 160 } |
160 | 161 |
161 protected: | 162 protected: |
162 base::MessageLoop message_loop_; | 163 base::MessageLoop message_loop_; |
163 ScopedAudioManagerPtr audio_manager_; | 164 ScopedAudioManagerPtr audio_manager_; |
164 }; | 165 }; |
165 | 166 |
166 // =========================================================================== | 167 // =========================================================================== |
167 // Validation of AudioManager::AUDIO_PCM_LINEAR | 168 // Validation of AudioManager::AUDIO_PCM_LINEAR |
168 // | 169 // |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 oas->Start(&source); | 638 oas->Start(&source); |
638 | 639 |
639 ::WaitForSingleObject(thread, INFINITE); | 640 ::WaitForSingleObject(thread, INFINITE); |
640 ::CloseHandle(thread); | 641 ::CloseHandle(thread); |
641 | 642 |
642 oas->Stop(); | 643 oas->Stop(); |
643 oas->Close(); | 644 oas->Close(); |
644 } | 645 } |
645 | 646 |
646 } // namespace media | 647 } // namespace media |
OLD | NEW |