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

Unified Diff: media/audio/audio_parameters_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/audio_parameters.cc ('k') | media/audio/audio_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_parameters_unittest.cc
diff --git a/media/audio/audio_parameters_unittest.cc b/media/audio/audio_parameters_unittest.cc
index da3e746fc2808b2ff9f47715e01007f0bd7de48d..bd3334f78a3e5b29f37b0b691affdc4595e9c6a7 100644
--- a/media/audio/audio_parameters_unittest.cc
+++ b/media/audio/audio_parameters_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -17,12 +17,12 @@ TEST(AudioParameters, Constructor_Default) {
AudioParameters params;
- EXPECT_EQ(expected_format, params.format);
- EXPECT_EQ(expected_bits, params.bits_per_sample);
- EXPECT_EQ(expected_channels, params.channels);
- EXPECT_EQ(expected_channel_layout, params.channel_layout);
- EXPECT_EQ(expected_rate, params.sample_rate);
- EXPECT_EQ(expected_samples, params.samples_per_packet);
+ EXPECT_EQ(expected_format, params.format());
+ EXPECT_EQ(expected_bits, params.bits_per_sample());
+ EXPECT_EQ(expected_channels, params.channels());
+ EXPECT_EQ(expected_channel_layout, params.channel_layout());
+ EXPECT_EQ(expected_rate, params.sample_rate());
+ EXPECT_EQ(expected_samples, params.frames_per_buffer());
}
TEST(AudioParameters, Constructor_ParameterValues) {
@@ -30,37 +30,37 @@ TEST(AudioParameters, Constructor_ParameterValues) {
AudioParameters::AUDIO_PCM_LOW_LATENCY;
int expected_bits = 16;
int expected_channels = 6;
- ChannelLayout expected_channel_layout = CHANNEL_LAYOUT_5POINT1;
+ ChannelLayout expected_channel_layout = CHANNEL_LAYOUT_5_1;
int expected_rate = 44100;
int expected_samples = 880;
AudioParameters params(expected_format, expected_channel_layout,
expected_rate, expected_bits, expected_samples);
- EXPECT_EQ(expected_format, params.format);
- EXPECT_EQ(expected_bits, params.bits_per_sample);
- EXPECT_EQ(expected_channels, params.channels);
- EXPECT_EQ(expected_channel_layout, params.channel_layout);
- EXPECT_EQ(expected_rate, params.sample_rate);
- EXPECT_EQ(expected_samples, params.samples_per_packet);
+ EXPECT_EQ(expected_format, params.format());
+ EXPECT_EQ(expected_bits, params.bits_per_sample());
+ EXPECT_EQ(expected_channels, params.channels());
+ EXPECT_EQ(expected_channel_layout, params.channel_layout());
+ EXPECT_EQ(expected_rate, params.sample_rate());
+ EXPECT_EQ(expected_samples, params.frames_per_buffer());
}
-TEST(AudioParameters, GetPacketSize) {
+TEST(AudioParameters, GetBytesPerBuffer) {
EXPECT_EQ(100, AudioParameters(AudioParameters::AUDIO_PCM_LINEAR,
CHANNEL_LAYOUT_MONO, 1000, 8, 100)
- .GetPacketSize());
+ .GetBytesPerBuffer());
EXPECT_EQ(200, AudioParameters(AudioParameters::AUDIO_PCM_LINEAR,
CHANNEL_LAYOUT_MONO, 1000, 16, 100)
- .GetPacketSize());
+ .GetBytesPerBuffer());
EXPECT_EQ(200, AudioParameters(AudioParameters::AUDIO_PCM_LINEAR,
CHANNEL_LAYOUT_STEREO, 1000, 8, 100)
- .GetPacketSize());
+ .GetBytesPerBuffer());
EXPECT_EQ(200, AudioParameters(AudioParameters::AUDIO_PCM_LINEAR,
CHANNEL_LAYOUT_MONO, 1000, 8, 200)
- .GetPacketSize());
+ .GetBytesPerBuffer());
EXPECT_EQ(800, AudioParameters(AudioParameters::AUDIO_PCM_LINEAR,
CHANNEL_LAYOUT_STEREO, 1000, 16, 200)
- .GetPacketSize());
+ .GetBytesPerBuffer());
}
TEST(AudioParameters, GetBytesPerSecond) {
« no previous file with comments | « media/audio/audio_parameters.cc ('k') | media/audio/audio_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698