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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
7 #include "media/audio/audio_parameters.h" | 7 #include "media/audio/audio_parameters.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // Verify that a value is never less than itself. | 201 // Verify that a value is never less than itself. |
202 EXPECT_FALSE(values[i] < values[i]); | 202 EXPECT_FALSE(values[i] < values[i]); |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 TEST(AudioParameters, Constructor_ValidChannelCounts) { | 206 TEST(AudioParameters, Constructor_ValidChannelCounts) { |
207 int expected_channels = 8; | 207 int expected_channels = 8; |
208 ChannelLayout expected_layout = CHANNEL_LAYOUT_5_1; | 208 ChannelLayout expected_layout = CHANNEL_LAYOUT_5_1; |
209 | 209 |
210 AudioParameters params(AudioParameters::AUDIO_PCM_LOW_LATENCY, | 210 AudioParameters params(AudioParameters::AUDIO_PCM_LOW_LATENCY, |
211 expected_layout, expected_channels, 44100, 16, 880, | 211 expected_channels, expected_layout, 44100, 16, 880); |
212 AudioParameters::NO_EFFECTS); | |
213 | 212 |
214 EXPECT_EQ(expected_channels, params.channels()); | 213 EXPECT_EQ(expected_channels, params.channels()); |
215 EXPECT_EQ(expected_layout, params.channel_layout()); | 214 EXPECT_EQ(expected_layout, params.channel_layout()); |
216 EXPECT_FALSE(params.IsValid()); | 215 EXPECT_FALSE(params.IsValid()); |
217 | 216 |
218 expected_layout = CHANNEL_LAYOUT_DISCRETE; | 217 expected_layout = CHANNEL_LAYOUT_DISCRETE; |
219 params.Reset(AudioParameters::AUDIO_PCM_LOW_LATENCY, expected_layout, | 218 params.Reset(AudioParameters::AUDIO_PCM_LOW_LATENCY, expected_layout, |
220 expected_channels, 44100, 16, 880); | 219 expected_channels, 44100, 16, 880); |
221 | 220 |
222 EXPECT_EQ(expected_channels, params.channels()); | 221 EXPECT_EQ(expected_channels, params.channels()); |
223 EXPECT_EQ(expected_layout, params.channel_layout()); | 222 EXPECT_EQ(expected_layout, params.channel_layout()); |
224 EXPECT_TRUE(params.IsValid()); | 223 EXPECT_TRUE(params.IsValid()); |
225 } | 224 } |
226 | 225 |
227 } // namespace media | 226 } // namespace media |
OLD | NEW |