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

Side by Side Diff: media/audio/audio_output_device_unittest.cc

Issue 1304973005: Refactor AudioParameters member setting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cross-platform fixes. Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/audio_output_resampler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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.
OLDNEW
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/audio_output_resampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698