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

Unified Diff: media/base/audio_bus_unittest.cc

Issue 1195633003: Add a silent audio sink to consume WebAudio data on silence detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ifdef android only constants Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/audio_bus.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_bus_unittest.cc
diff --git a/media/base/audio_bus_unittest.cc b/media/base/audio_bus_unittest.cc
index 85d6aa3203a9d28acf1ff946dd2078e2e697e1f4..ea06f0a19d77bee38ee20849559c0b4146b60068 100644
--- a/media/base/audio_bus_unittest.cc
+++ b/media/base/audio_bus_unittest.cc
@@ -205,6 +205,7 @@ TEST_F(AudioBusTest, Zero) {
// Fill the bus with dummy data.
for (int i = 0; i < bus->channels(); ++i)
std::fill(bus->channel(i), bus->channel(i) + bus->frames(), i + 1);
+ EXPECT_FALSE(bus->AreFramesZero());
// Zero first half the frames of each channel.
bus->ZeroFrames(kFrameCount / 2);
@@ -214,6 +215,7 @@ TEST_F(AudioBusTest, Zero) {
VerifyValue(bus->channel(i) + kFrameCount / 2,
kFrameCount - kFrameCount / 2, i + 1);
}
+ EXPECT_FALSE(bus->AreFramesZero());
// Fill the bus with dummy data.
for (int i = 0; i < bus->channels(); ++i)
@@ -227,6 +229,7 @@ TEST_F(AudioBusTest, Zero) {
kFrameCount - kFrameCount / 2, 0);
VerifyValue(bus->channel(i), kFrameCount / 2, i + 1);
}
+ EXPECT_FALSE(bus->AreFramesZero());
// Fill the bus with dummy data.
for (int i = 0; i < bus->channels(); ++i)
@@ -238,6 +241,7 @@ TEST_F(AudioBusTest, Zero) {
SCOPED_TRACE("All Zero");
VerifyValue(bus->channel(i), bus->frames(), 0);
}
+ EXPECT_TRUE(bus->AreFramesZero());
}
// Each test vector represents two channels of data in the following arbitrary
« no previous file with comments | « media/base/audio_bus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698