| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 DISALLOW_COPY_AND_ASSIGN(AudioOutputDeviceTest); | 115 DISALLOW_COPY_AND_ASSIGN(AudioOutputDeviceTest); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 int AudioOutputDeviceTest::CalculateMemorySize() { | 118 int AudioOutputDeviceTest::CalculateMemorySize() { |
| 119 // Calculate output memory size. | 119 // Calculate output memory size. |
| 120 return AudioBus::CalculateMemorySize(default_audio_parameters_); | 120 return AudioBus::CalculateMemorySize(default_audio_parameters_); |
| 121 } | 121 } |
| 122 | 122 |
| 123 AudioOutputDeviceTest::AudioOutputDeviceTest() { | 123 AudioOutputDeviceTest::AudioOutputDeviceTest() { |
| 124 default_audio_parameters_.Reset( | 124 default_audio_parameters_.Reset(AudioParameters::AUDIO_PCM_LINEAR, |
| 125 AudioParameters::AUDIO_PCM_LINEAR, | 125 CHANNEL_LAYOUT_STEREO, 48000, 16, 1024); |
| 126 CHANNEL_LAYOUT_STEREO, 2, 48000, 16, 1024); | |
| 127 | 126 |
| 128 audio_output_ipc_ = new MockAudioOutputIPC(); | 127 audio_output_ipc_ = new MockAudioOutputIPC(); |
| 129 audio_device_ = new AudioOutputDevice( | 128 audio_device_ = new AudioOutputDevice( |
| 130 scoped_ptr<AudioOutputIPC>(audio_output_ipc_), | 129 scoped_ptr<AudioOutputIPC>(audio_output_ipc_), |
| 131 io_loop_.task_runner()); | 130 io_loop_.task_runner()); |
| 132 | 131 |
| 133 audio_device_->Initialize(default_audio_parameters_, | 132 audio_device_->Initialize(default_audio_parameters_, |
| 134 &callback_); | 133 &callback_); |
| 135 | 134 |
| 136 io_loop_.RunUntilIdle(); | 135 io_loop_.RunUntilIdle(); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // Switch the output device | 279 // Switch the output device |
| 281 TEST_P(AudioOutputDeviceTest, SwitchOutputDevice) { | 280 TEST_P(AudioOutputDeviceTest, SwitchOutputDevice) { |
| 282 StartAudioDevice(); | 281 StartAudioDevice(); |
| 283 SwitchOutputDevice(); | 282 SwitchOutputDevice(); |
| 284 StopAudioDevice(); | 283 StopAudioDevice(); |
| 285 } | 284 } |
| 286 | 285 |
| 287 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); | 286 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); |
| 288 | 287 |
| 289 } // namespace media. | 288 } // namespace media. |
| OLD | NEW |