summaryrefslogtreecommitdiffstats
path: root/remoting/client
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 04:19:50 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 04:19:50 +0000
commitf9e3dde240ede48387fe1ad5dc8ef7a51a2446b7 (patch)
treedb76be52410dd632bd0c4c08f43b92cc1058e8f8 /remoting/client
parent9073ade69a87ee724b4cd870fc5b5259cf8c68af (diff)
downloadchromium_src-f9e3dde240ede48387fe1ad5dc8ef7a51a2446b7.zip
chromium_src-f9e3dde240ede48387fe1ad5dc8ef7a51a2446b7.tar.gz
chromium_src-f9e3dde240ede48387fe1ad5dc8ef7a51a2446b7.tar.bz2
Valgrind/Heapchecker: Fix leak in remoting AudioPlayerTests.
BUG=154986 TBR=garykac,eugenis Review URL: https://codereview.chromium.org/11087042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161039 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r--remoting/client/audio_player_unittest.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/remoting/client/audio_player_unittest.cc b/remoting/client/audio_player_unittest.cc
index e4e6fa6..e9b8637 100644
--- a/remoting/client/audio_player_unittest.cc
+++ b/remoting/client/audio_player_unittest.cc
@@ -4,8 +4,8 @@
#include "remoting/client/audio_player.h"
+#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "remoting/client/audio_player.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -26,13 +26,13 @@ namespace remoting {
class FakeAudioPlayer : public AudioPlayer {
public:
- FakeAudioPlayer() {};
+ FakeAudioPlayer() {}
- bool ResetAudioPlayer(AudioPacket::SamplingRate) {
+ bool ResetAudioPlayer(AudioPacket::SamplingRate) OVERRIDE {
return true;
};
- uint32 GetSamplesPerFrame() {
+ uint32 GetSamplesPerFrame() OVERRIDE {
return kAudioSamplesPerFrame;
};
};
@@ -44,7 +44,12 @@ class AudioPlayerTest : public ::testing::Test {
buffer_.reset(new char[kAudioFrameBytes + kPaddingBytes]);
}
- virtual void TearDown() {}
+ virtual void TearDown() {
+ // Drain the samples from |audio_|.
+ while (GetNumQueuedPackets() > 0) {
+ ConsumeAudioFrame();
+ }
+ }
void ConsumeAudioFrame() {
uint8* buffer = reinterpret_cast<uint8*>(buffer_.get());