OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "media/audio/audio_manager.h" | |
10 #include "media/audio/fake_audio_output_stream.h" | 9 #include "media/audio/fake_audio_output_stream.h" |
11 #include "media/audio/simple_sources.h" | 10 #include "media/audio/simple_sources.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
13 | 12 |
14 namespace { | 13 namespace { |
15 | 14 |
16 void GenerateRandomData(char* buffer, uint32 len) { | 15 void GenerateRandomData(char* buffer, uint32 len) { |
17 static bool called = false; | 16 static bool called = false; |
18 if (!called) { | 17 if (!called) { |
19 called = true; | 18 called = true; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 EXPECT_EQ(0, last_buffer[0]); | 98 EXPECT_EQ(0, last_buffer[0]); |
100 EXPECT_EQ(5126, last_buffer[1]); | 99 EXPECT_EQ(5126, last_buffer[1]); |
101 EXPECT_TRUE(last_buffer[1] < last_buffer[2]); | 100 EXPECT_TRUE(last_buffer[1] < last_buffer[2]); |
102 EXPECT_TRUE(last_buffer[2] < last_buffer[3]); | 101 EXPECT_TRUE(last_buffer[2] < last_buffer[3]); |
103 // Spot test negative incursion of sine wave. | 102 // Spot test negative incursion of sine wave. |
104 EXPECT_EQ(0, last_buffer[half_period]); | 103 EXPECT_EQ(0, last_buffer[half_period]); |
105 EXPECT_EQ(-5126, last_buffer[half_period + 1]); | 104 EXPECT_EQ(-5126, last_buffer[half_period + 1]); |
106 EXPECT_TRUE(last_buffer[half_period + 1] > last_buffer[half_period + 2]); | 105 EXPECT_TRUE(last_buffer[half_period + 1] > last_buffer[half_period + 2]); |
107 EXPECT_TRUE(last_buffer[half_period + 2] > last_buffer[half_period + 3]); | 106 EXPECT_TRUE(last_buffer[half_period + 2] > last_buffer[half_period + 3]); |
108 } | 107 } |
OLD | NEW |