Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1097)

Unified Diff: media/audio/win/audio_low_latency_input_win_unittest.cc

Issue 1806313003: Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/win/audio_low_latency_input_win_unittest.cc
diff --git a/media/audio/win/audio_low_latency_input_win_unittest.cc b/media/audio/win/audio_low_latency_input_win_unittest.cc
index 8a9f366d9c461a1edf4404b10e35117f958d8b43..90057080b8f85a42d9a506413d98017dd3b74521 100644
--- a/media/audio/win/audio_low_latency_input_win_unittest.cc
+++ b/media/audio/win/audio_low_latency_input_win_unittest.cc
@@ -253,7 +253,9 @@ class ScopedAudioInputStream {
// Verify that we can retrieve the current hardware/mixing sample rate
// for all available input devices.
TEST(WinAudioInputTest, WASAPIAudioInputStreamHardwareSampleRate) {
- scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
+ base::MessageLoop loop;
+ ScopedAudioManagerPtr audio_manager(
+ AudioManager::CreateForTesting(loop.task_runner()));
ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get()));
// Retrieve a list of all available input devices.
@@ -273,7 +275,9 @@ TEST(WinAudioInputTest, WASAPIAudioInputStreamHardwareSampleRate) {
// Test Create(), Close() calling sequence.
TEST(WinAudioInputTest, WASAPIAudioInputStreamCreateAndClose) {
- scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
+ base::MessageLoop loop;
+ ScopedAudioManagerPtr audio_manager(
+ AudioManager::CreateForTesting(loop.task_runner()));
ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get()));
ScopedAudioInputStream ais(
CreateDefaultAudioInputStream(audio_manager.get()));
@@ -282,7 +286,9 @@ TEST(WinAudioInputTest, WASAPIAudioInputStreamCreateAndClose) {
// Test Open(), Close() calling sequence.
TEST(WinAudioInputTest, WASAPIAudioInputStreamOpenAndClose) {
- scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
+ base::MessageLoop loop;
+ ScopedAudioManagerPtr audio_manager(
+ AudioManager::CreateForTesting(loop.task_runner()));
ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get()));
ScopedAudioInputStream ais(
CreateDefaultAudioInputStream(audio_manager.get()));
@@ -292,7 +298,9 @@ TEST(WinAudioInputTest, WASAPIAudioInputStreamOpenAndClose) {
// Test Open(), Start(), Close() calling sequence.
TEST(WinAudioInputTest, WASAPIAudioInputStreamOpenStartAndClose) {
- scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
+ base::MessageLoop loop;
+ ScopedAudioManagerPtr audio_manager(
+ AudioManager::CreateForTesting(loop.task_runner()));
ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get()));
ScopedAudioInputStream ais(
CreateDefaultAudioInputStream(audio_manager.get()));
@@ -304,7 +312,9 @@ TEST(WinAudioInputTest, WASAPIAudioInputStreamOpenStartAndClose) {
// Test Open(), Start(), Stop(), Close() calling sequence.
TEST(WinAudioInputTest, WASAPIAudioInputStreamOpenStartStopAndClose) {
- scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
+ base::MessageLoop loop;
+ ScopedAudioManagerPtr audio_manager(
+ AudioManager::CreateForTesting(loop.task_runner()));
ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get()));
ScopedAudioInputStream ais(
CreateDefaultAudioInputStream(audio_manager.get()));
@@ -317,7 +327,9 @@ TEST(WinAudioInputTest, WASAPIAudioInputStreamOpenStartStopAndClose) {
// Test some additional calling sequences.
TEST(WinAudioInputTest, WASAPIAudioInputStreamMiscCallingSequences) {
- scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
+ base::MessageLoop loop;
+ ScopedAudioManagerPtr audio_manager(
+ AudioManager::CreateForTesting(loop.task_runner()));
ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get()));
ScopedAudioInputStream ais(
CreateDefaultAudioInputStream(audio_manager.get()));
@@ -345,11 +357,12 @@ TEST(WinAudioInputTest, WASAPIAudioInputStreamMiscCallingSequences) {
}
TEST(WinAudioInputTest, WASAPIAudioInputStreamTestPacketSizes) {
- scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
+ base::MessageLoopForUI loop;
+ ScopedAudioManagerPtr audio_manager(
+ AudioManager::CreateForTesting(loop.task_runner()));
ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get()));
int count = 0;
- base::MessageLoopForUI loop;
// 10 ms packet size.
@@ -415,7 +428,9 @@ TEST(WinAudioInputTest, WASAPIAudioInputStreamTestPacketSizes) {
// Test that we can capture a stream in loopback.
TEST(WinAudioInputTest, WASAPIAudioInputStreamLoopback) {
- scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
+ base::MessageLoop loop;
+ ScopedAudioManagerPtr audio_manager(
+ AudioManager::CreateForTesting(loop.task_runner()));
ABORT_AUDIO_TEST_IF_NOT(audio_manager->HasAudioOutputDevices() &&
CoreAudioUtil::IsSupported());
@@ -449,7 +464,9 @@ TEST(WinAudioInputTest, WASAPIAudioInputStreamLoopback) {
// with --gtest_also_run_disabled_tests or set the GTEST_ALSO_RUN_DISABLED_TESTS
// environment variable to a value greater than 0.
TEST(WinAudioInputTest, DISABLED_WASAPIAudioInputStreamRecordToFile) {
- scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
+ base::MessageLoop loop;
+ ScopedAudioManagerPtr audio_manager(
+ AudioManager::CreateForTesting(loop.task_runner()));
ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get()));
// Name of the output PCM file containing captured data. The output file

Powered by Google App Engine
This is Rietveld 408576698