Commit f02ad19b authored by enal@chromium.org's avatar enal@chromium.org

Fix test -- we should initialize the buffer, otherwise valgrind/DrMemory reports

read from uninitialized memory. Mixer reads data from there, even though test
does not use mixed output.

BUG=125723

Review URL: http://codereview.chromium.org/10268026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134749 0039d316-1c4b-4281-b951-d872f2087c98
parent f12e6a4a
......@@ -16,9 +16,12 @@
using ::testing::_;
using ::testing::AllOf;
using ::testing::DoAll;
using ::testing::Field;
using ::testing::Mock;
using ::testing::NotNull;
using ::testing::Return;
using ::testing::SetArrayArgument;
using media::AudioBuffersState;
using media::AudioInputStream;
using media::AudioManager;
......@@ -462,25 +465,29 @@ TEST_F(AudioOutputProxyTest, TwoStreams_BothPlaying_Mixer) {
EXPECT_TRUE(proxy2->Open());
proxy1->Start(&callback_);
uint8 zeroes[4] = {0, 0, 0, 0};
uint8 buf1[4] = {0};
EXPECT_CALL(callback_,
OnMoreData(_, 4,
OnMoreData(NotNull(), 4,
AllOf(Field(&AudioBuffersState::pending_bytes, 0),
Field(&AudioBuffersState::hardware_delay_bytes, 0))))
.WillOnce(Return(4));
.WillOnce(DoAll(SetArrayArgument<0>(zeroes, zeroes + sizeof(zeroes)),
Return(4)));
mixer_->OnMoreData(buf1, sizeof(buf1), AudioBuffersState(0, 0));
proxy2->Start(&callback_);
uint8 buf2[4] = {0};
EXPECT_CALL(callback_,
OnMoreData(_, 4,
OnMoreData(NotNull(), 4,
AllOf(Field(&AudioBuffersState::pending_bytes, 4),
Field(&AudioBuffersState::hardware_delay_bytes, 0))))
.WillOnce(Return(4));
.WillOnce(DoAll(SetArrayArgument<0>(zeroes, zeroes + sizeof(zeroes)),
Return(4)));
EXPECT_CALL(callback_,
OnMoreData(_, 4,
OnMoreData(NotNull(), 4,
AllOf(Field(&AudioBuffersState::pending_bytes, 0),
Field(&AudioBuffersState::hardware_delay_bytes, 0))))
.WillOnce(Return(4));
.WillOnce(DoAll(SetArrayArgument<0>(zeroes, zeroes + sizeof(zeroes)),
Return(4)));
mixer_->OnMoreData(buf2, sizeof(buf2), AudioBuffersState(4, 0));
proxy1->Stop();
proxy2->Stop();
......
......@@ -1326,15 +1326,6 @@ name=http://crbug.com/125565
*!SiteInstanceImpl::GetProcess
*!BrowserTestOffTheRecord_DelayProfileDestruction_Test::TestBody
# True uninit in media_unittests.
UNINITIALIZED READ
name=http://crbug.com/125723
*!media::AddSaturated<*>
*!media::MixStreams<*>
*!media::MixStreams
*!media::AudioOutputMixer::OnMoreData
*!media::AudioOutputProxyTest_TwoStreams_BothPlaying_Mixer_Test::TestBody
LEAK
name=http://crbug.com/125724
*!operator new
......
......@@ -2417,12 +2417,3 @@
fun:_ZN8remoting8protocol21AuthenticatorTestBase14RunChannelAuthEb
fun:_ZN8remoting8protocol52NegotiatingAuthenticatorTest_SuccessfulAuthHmac_Test8TestBodyEv
}
{
bug_125728
Memcheck:Uninitialized
fun:_ZN5mediaL12AddSaturatedIiLin32768ELi32767EEEiii
fun:_ZN5mediaL10MixStreamsIsiLin32768ELi32767ELi0EEEvPT_S2_if
fun:_ZN5media10MixStreamsEPvS0_mif
fun:_ZN5media16AudioOutputMixer10OnMoreDataEPhjNS_17AudioBuffersStateE
fun:_ZN5media54AudioOutputProxyTest_TwoStreams_BothPlaying_Mixer_Test8TestBodyEv
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment