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 // TODO(henrika): add test which included |start_frame| in Consume() call. | 5 // TODO(henrika): add test which included |start_frame| in Consume() call. |
6 | 6 |
7 #include "media/base/audio_fifo.h" | 7 #include "media/base/audio_fifo.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 { |
11 | 11 |
12 class AudioFifoTest : public testing::Test { | 12 class AudioFifoTest : public testing::Test { |
13 public: | 13 public: |
14 AudioFifoTest() {} | 14 AudioFifoTest() {} |
15 virtual ~AudioFifoTest() {} | 15 ~AudioFifoTest() override {} |
16 | 16 |
17 void VerifyValue(const float data[], int size, float value) { | 17 void VerifyValue(const float data[], int size, float value) { |
18 for (int i = 0; i < size; ++i) | 18 for (int i = 0; i < size; ++i) |
19 ASSERT_FLOAT_EQ(value, data[i]) << "i=" << i; | 19 ASSERT_FLOAT_EQ(value, data[i]) << "i=" << i; |
20 } | 20 } |
21 | 21 |
22 protected: | 22 protected: |
23 DISALLOW_COPY_AND_ASSIGN(AudioFifoTest); | 23 DISALLOW_COPY_AND_ASSIGN(AudioFifoTest); |
24 }; | 24 }; |
25 | 25 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 VerifyValue(bus->channel(j), bus->channels(), value); | 185 VerifyValue(bus->channel(j), bus->channels(), value); |
186 std::fill(bus->channel(j), bus->channel(j) + bus->frames(), value + 1); | 186 std::fill(bus->channel(j), bus->channel(j) + bus->frames(), value + 1); |
187 } | 187 } |
188 fifo.Push(bus.get()); | 188 fifo.Push(bus.get()); |
189 EXPECT_EQ(fifo.frames(), bus->frames()); | 189 EXPECT_EQ(fifo.frames(), bus->frames()); |
190 ++value; | 190 ++value; |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 } // namespace media | 194 } // namespace media |
OLD | NEW |