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 <memory> |
| 6 |
5 #include "base/bind.h" | 7 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
7 #include "base/macros.h" | 9 #include "base/macros.h" |
8 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
9 #include "media/base/audio_bus.h" | 11 #include "media/base/audio_bus.h" |
10 #include "media/base/audio_pull_fifo.h" | 12 #include "media/base/audio_pull_fifo.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
12 | 14 |
13 namespace media { | 15 namespace media { |
14 | 16 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 for (int j = 0; j < audio_bus->channels(); ++j) { | 76 for (int j = 0; j < audio_bus->channels(); ++j) { |
75 // Store same value in all channels. | 77 // Store same value in all channels. |
76 audio_bus->channel(j)[i] = fill_value_; | 78 audio_bus->channel(j)[i] = fill_value_; |
77 } | 79 } |
78 fill_value_++; | 80 fill_value_++; |
79 } | 81 } |
80 } | 82 } |
81 | 83 |
82 protected: | 84 protected: |
83 AudioPullFifo pull_fifo_; | 85 AudioPullFifo pull_fifo_; |
84 scoped_ptr<AudioBus> audio_bus_; | 86 std::unique_ptr<AudioBus> audio_bus_; |
85 int fill_value_; | 87 int fill_value_; |
86 int last_frame_delay_; | 88 int last_frame_delay_; |
87 | 89 |
88 DISALLOW_COPY_AND_ASSIGN(AudioPullFifoTest); | 90 DISALLOW_COPY_AND_ASSIGN(AudioPullFifoTest); |
89 }; | 91 }; |
90 | 92 |
91 TEST_P(AudioPullFifoTest, Consume) { | 93 TEST_P(AudioPullFifoTest, Consume) { |
92 ConsumeTest(GetParam()); | 94 ConsumeTest(GetParam()); |
93 } | 95 } |
94 | 96 |
95 // Test common |frames_to_consume| values which will be used as input | 97 // Test common |frames_to_consume| values which will be used as input |
96 // parameter to AudioPullFifo::Consume() when the consumer asks for data. | 98 // parameter to AudioPullFifo::Consume() when the consumer asks for data. |
97 INSTANTIATE_TEST_CASE_P( | 99 INSTANTIATE_TEST_CASE_P( |
98 AudioPullFifoTest, AudioPullFifoTest, | 100 AudioPullFifoTest, AudioPullFifoTest, |
99 testing::Values(544, 512, 512, 512, 512, 2048, 544, 441, 440, 433, 500)); | 101 testing::Values(544, 512, 512, 512, 512, 2048, 544, 441, 440, 433, 500)); |
100 | 102 |
101 } // namespace media | 103 } // namespace media |
OLD | NEW |