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

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

Issue 11233023: Handle audio device changes on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No ctor thread check. Created 8 years, 1 month 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
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/string_number_conversions.h" 6 #include "base/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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, 147 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY,
148 CHANNEL_LAYOUT_STEREO, 2000, 8, 100), 148 CHANNEL_LAYOUT_STEREO, 2000, 8, 100),
149 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, 149 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY,
150 CHANNEL_LAYOUT_STEREO, 2000, 8, 200), 150 CHANNEL_LAYOUT_STEREO, 2000, 8, 200),
151 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, 151 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY,
152 CHANNEL_LAYOUT_STEREO, 2000, 16, 100), 152 CHANNEL_LAYOUT_STEREO, 2000, 16, 100),
153 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, 153 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY,
154 CHANNEL_LAYOUT_STEREO, 2000, 16, 200), 154 CHANNEL_LAYOUT_STEREO, 2000, 16, 200),
155 }; 155 };
156 156
157 AudioParameters::Compare target;
158 for (size_t i = 0; i < arraysize(values); ++i) { 157 for (size_t i = 0; i < arraysize(values); ++i) {
159 for (size_t j = 0; j < arraysize(values); ++j) { 158 for (size_t j = 0; j < arraysize(values); ++j) {
160 SCOPED_TRACE("i=" + base::IntToString(i) + " j=" + base::IntToString(j)); 159 SCOPED_TRACE("i=" + base::IntToString(i) + " j=" + base::IntToString(j));
161 EXPECT_EQ(i < j, target(values[i], values[j])); 160 EXPECT_EQ(i < j, values[i] < values[j]);
162 } 161 }
163 162
164 // Verify that a value is never less than itself. 163 // Verify that a value is never less than itself.
165 EXPECT_FALSE(target(values[i], values[i])); 164 EXPECT_FALSE(values[i] < values[i]);
166 } 165 }
167 } 166 }
168 167
169 } // namespace media 168 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698