Index: media/base/audio_bus_unittest.cc |
diff --git a/media/base/audio_bus_unittest.cc b/media/base/audio_bus_unittest.cc |
index 63dcb0cad0aaa85e0b47dc41c92df289a04d3828..1dfb4b90519172ecb8bc9ccc264b05da76cf8040 100644 |
--- a/media/base/audio_bus_unittest.cc |
+++ b/media/base/audio_bus_unittest.cc |
@@ -132,6 +132,23 @@ TEST_F(AudioBusTest, CreateUsingAudioParameters) { |
VerifyReadWriteAndAlignment(bus.get()); |
} |
+// Verify an AudioBus created via CreateWrapper(...) works as advertised. |
+TEST_F(AudioBusTest, CreateWrapper) { |
+ data_.reserve(kChannels); |
+ for (int i = 0; i < kChannels; ++i) { |
+ data_.push_back(static_cast<float*>(base::AlignedAlloc( |
+ sizeof(*data_[i]) * kFrameCount, AudioBus::kChannelAlignment))); |
+ } |
+ |
+ std::unique_ptr<AudioBus> bus = AudioBus::CreateWrapper(kChannels); |
+ bus->set_frames(kFrameCount); |
+ for (int i = 0; i < bus->channels(); ++i) |
+ bus->SetChannelData(i, data_[i]); |
+ |
+ VerifyChannelAndFrameCount(bus.get()); |
+ VerifyReadWriteAndAlignment(bus.get()); |
+} |
+ |
// Verify an AudioBus created via wrapping a vector works as advertised. |
TEST_F(AudioBusTest, WrapVector) { |
data_.reserve(kChannels); |