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

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

Issue 9655018: Make AudioParameters a class instead of a struct (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright years Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_input_controller.cc ('k') | media/audio/audio_input_volume_unittest.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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/environment.h" 6 #include "base/environment.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
10 #include "media/audio/audio_io.h" 10 #include "media/audio/audio_io.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 // Test that AudioInputStream rejects out of range parameters. 85 // Test that AudioInputStream rejects out of range parameters.
86 TEST(AudioInputTest, SanityOnMakeParams) { 86 TEST(AudioInputTest, SanityOnMakeParams) {
87 scoped_ptr<AudioManager> audio_man(AudioManager::Create()); 87 scoped_ptr<AudioManager> audio_man(AudioManager::Create());
88 if (!CanRunAudioTests(audio_man.get())) 88 if (!CanRunAudioTests(audio_man.get()))
89 return; 89 return;
90 90
91 AudioParameters::Format fmt = AudioParameters::AUDIO_PCM_LINEAR; 91 AudioParameters::Format fmt = AudioParameters::AUDIO_PCM_LINEAR;
92 EXPECT_TRUE(NULL == audio_man->MakeAudioInputStream( 92 EXPECT_TRUE(NULL == audio_man->MakeAudioInputStream(
93 AudioParameters(fmt, CHANNEL_LAYOUT_7POINT1, 8000, 16, 93 AudioParameters(fmt, CHANNEL_LAYOUT_7_1, 8000, 16,
94 kSamplesPerPacket), AudioManagerBase::kDefaultDeviceId)); 94 kSamplesPerPacket), AudioManagerBase::kDefaultDeviceId));
95 EXPECT_TRUE(NULL == audio_man->MakeAudioInputStream( 95 EXPECT_TRUE(NULL == audio_man->MakeAudioInputStream(
96 AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 1024 * 1024, 16, 96 AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 1024 * 1024, 16,
97 kSamplesPerPacket), AudioManagerBase::kDefaultDeviceId)); 97 kSamplesPerPacket), AudioManagerBase::kDefaultDeviceId));
98 EXPECT_TRUE(NULL == audio_man->MakeAudioInputStream( 98 EXPECT_TRUE(NULL == audio_man->MakeAudioInputStream(
99 AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, 8000, 80, 99 AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, 8000, 80,
100 kSamplesPerPacket), AudioManagerBase::kDefaultDeviceId)); 100 kSamplesPerPacket), AudioManagerBase::kDefaultDeviceId));
101 EXPECT_TRUE(NULL == audio_man->MakeAudioInputStream( 101 EXPECT_TRUE(NULL == audio_man->MakeAudioInputStream(
102 AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, 8000, 80, 102 AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, 8000, 80,
103 1000 * kSamplesPerPacket), 103 1000 * kSamplesPerPacket),
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 FROM_HERE, 163 FROM_HERE,
164 MessageLoop::QuitClosure(), 164 MessageLoop::QuitClosure(),
165 base::TimeDelta::FromMilliseconds(590)); 165 base::TimeDelta::FromMilliseconds(590));
166 message_loop.Run(); 166 message_loop.Run();
167 EXPECT_GE(test_callback.callback_count(), 10); 167 EXPECT_GE(test_callback.callback_count(), 10);
168 EXPECT_FALSE(test_callback.had_error()); 168 EXPECT_FALSE(test_callback.had_error());
169 169
170 ais->Stop(); 170 ais->Stop();
171 ais->Close(); 171 ais->Close();
172 } 172 }
OLDNEW
« no previous file with comments | « media/audio/audio_input_controller.cc ('k') | media/audio/audio_input_volume_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698