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

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

Issue 9965076: Revert 130180 - Move media/audio files into media namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/simple_sources.cc ('k') | media/audio/win/audio_low_latency_input_win.h » ('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/logging.h" 5 #include "base/logging.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "media/audio/audio_manager.h" 9 #include "media/audio/audio_manager.h"
10 #include "media/audio/fake_audio_output_stream.h" 10 #include "media/audio/fake_audio_output_stream.h"
11 #include "media/audio/simple_sources.h" 11 #include "media/audio/simple_sources.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace media {
15
16 static void GenerateRandomData(char* buffer, uint32 len) { 14 static void GenerateRandomData(char* buffer, uint32 len) {
17 static bool called = false; 15 static bool called = false;
18 if (!called) { 16 if (!called) {
19 called = true; 17 called = true;
20 int seed = static_cast<int>(base::Time::Now().ToInternalValue()); 18 int seed = static_cast<int>(base::Time::Now().ToInternalValue());
21 srand(seed); 19 srand(seed);
22 VLOG(1) << "Random seed: " << seed; 20 VLOG(1) << "Random seed: " << seed;
23 } 21 }
24 22
25 for (uint32 i = 0; i < len; i++) 23 for (uint32 i = 0; i < len; i++)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 EXPECT_EQ(5126, last_buffer[1]); 92 EXPECT_EQ(5126, last_buffer[1]);
95 EXPECT_TRUE(last_buffer[1] < last_buffer[2]); 93 EXPECT_TRUE(last_buffer[1] < last_buffer[2]);
96 EXPECT_TRUE(last_buffer[2] < last_buffer[3]); 94 EXPECT_TRUE(last_buffer[2] < last_buffer[3]);
97 // Spot test negative incursion of sine wave. 95 // Spot test negative incursion of sine wave.
98 EXPECT_EQ(0, last_buffer[half_period]); 96 EXPECT_EQ(0, last_buffer[half_period]);
99 EXPECT_EQ(-5126, last_buffer[half_period + 1]); 97 EXPECT_EQ(-5126, last_buffer[half_period + 1]);
100 EXPECT_TRUE(last_buffer[half_period + 1] > last_buffer[half_period + 2]); 98 EXPECT_TRUE(last_buffer[half_period + 1] > last_buffer[half_period + 2]);
101 EXPECT_TRUE(last_buffer[half_period + 2] > last_buffer[half_period + 3]); 99 EXPECT_TRUE(last_buffer[half_period + 2] > last_buffer[half_period + 3]);
102 oas->Close(); 100 oas->Close();
103 } 101 }
104
105 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/simple_sources.cc ('k') | media/audio/win/audio_low_latency_input_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698