diff options
author | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 11:19:36 +0000 |
---|---|---|
committer | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 11:19:36 +0000 |
commit | 44ea8c724f68466ba84a574540f799085b69871e (patch) | |
tree | e3e158760f54049b4a08864f368b619ca1d377fd /content/test | |
parent | e1daf4dfcb1e551530d3dc47099fbfa5a54cb6f9 (diff) | |
download | chromium_src-44ea8c724f68466ba84a574540f799085b69871e.zip chromium_src-44ea8c724f68466ba84a574540f799085b69871e.tar.gz chromium_src-44ea8c724f68466ba84a574540f799085b69871e.tar.bz2 |
Disable leaky tests in LeakSanitizer builds.
Some of the tests which don't run under Valgrind or Heapchecker are now also
disabled under LeakSanitizer:
- WebRTCAudioDevice.* (temporarily disabled)
- DiskCacheBackend crash tests (do not compile in LSan builds due to intentional leaks)
BUG=74417,148865
R=rvargas@chromium.org
TBR=tommi@chromium.org
Review URL: https://chromiumcodereview.appspot.com/21377002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214999 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test')
-rw-r--r-- | content/test/webrtc_audio_device_test.cc | 41 | ||||
-rw-r--r-- | content/test/webrtc_audio_device_test.h | 15 |
2 files changed, 33 insertions, 23 deletions
diff --git a/content/test/webrtc_audio_device_test.cc b/content/test/webrtc_audio_device_test.cc index d5c3c65..eb5b1df 100644 --- a/content/test/webrtc_audio_device_test.cc +++ b/content/test/webrtc_audio_device_test.cc @@ -120,14 +120,14 @@ ACTION_P(QuitMessageLoop, loop_or_proxy) { loop_or_proxy->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } -WebRTCAudioDeviceTest::WebRTCAudioDeviceTest() +MAYBE_WebRTCAudioDeviceTest::MAYBE_WebRTCAudioDeviceTest() : render_thread_(NULL), audio_hardware_config_(NULL), has_input_devices_(false), has_output_devices_(false) { } -WebRTCAudioDeviceTest::~WebRTCAudioDeviceTest() {} +MAYBE_WebRTCAudioDeviceTest::~MAYBE_WebRTCAudioDeviceTest() {} -void WebRTCAudioDeviceTest::SetUp() { +void MAYBE_WebRTCAudioDeviceTest::SetUp() { // This part sets up a RenderThread environment to ensure that // RenderThread::current() (<=> TLS pointer) is valid. // Main parts are inspired by the RenderViewFakeResourcesTest. @@ -143,7 +143,7 @@ void WebRTCAudioDeviceTest::SetUp() { static const char kThreadName[] = "RenderThread"; ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE, - base::Bind(&WebRTCAudioDeviceTest::InitializeIOThread, + base::Bind(&MAYBE_WebRTCAudioDeviceTest::InitializeIOThread, base::Unretained(this), kThreadName)); WaitForIOThreadCompletion(); @@ -152,7 +152,7 @@ void WebRTCAudioDeviceTest::SetUp() { render_thread_ = new RenderThreadImpl(kThreadName); } -void WebRTCAudioDeviceTest::TearDown() { +void MAYBE_WebRTCAudioDeviceTest::TearDown() { SetAudioHardwareConfig(NULL); // Run any pending cleanup tasks that may have been posted to the main thread. @@ -161,7 +161,7 @@ void WebRTCAudioDeviceTest::TearDown() { // Kick of the cleanup process by closing the channel. This queues up // OnStreamClosed calls to be executed on the audio thread. ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE, - base::Bind(&WebRTCAudioDeviceTest::DestroyChannel, + base::Bind(&MAYBE_WebRTCAudioDeviceTest::DestroyChannel, base::Unretained(this))); WaitForIOThreadCompletion(); @@ -174,7 +174,7 @@ void WebRTCAudioDeviceTest::TearDown() { WaitForAudioManagerCompletion(); ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE, - base::Bind(&WebRTCAudioDeviceTest::UninitializeIOThread, + base::Bind(&MAYBE_WebRTCAudioDeviceTest::UninitializeIOThread, base::Unretained((this)))); WaitForIOThreadCompletion(); mock_process_.reset(); @@ -184,16 +184,16 @@ void WebRTCAudioDeviceTest::TearDown() { sandbox_was_enabled_); } -bool WebRTCAudioDeviceTest::Send(IPC::Message* message) { +bool MAYBE_WebRTCAudioDeviceTest::Send(IPC::Message* message) { return channel_->Send(message); } -void WebRTCAudioDeviceTest::SetAudioHardwareConfig( +void MAYBE_WebRTCAudioDeviceTest::SetAudioHardwareConfig( media::AudioHardwareConfig* hardware_config) { audio_hardware_config_ = hardware_config; } -void WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) { +void MAYBE_WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) { #if defined(OS_WIN) // We initialize COM (STA) on our IO thread as is done in Chrome. // See BrowserProcessSubThread::Init. @@ -223,7 +223,7 @@ void WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) { CreateChannel(thread_name); } -void WebRTCAudioDeviceTest::UninitializeIOThread() { +void MAYBE_WebRTCAudioDeviceTest::UninitializeIOThread() { resource_context_.reset(); test_request_context_.reset(); @@ -235,7 +235,7 @@ void WebRTCAudioDeviceTest::UninitializeIOThread() { audio_manager_.reset(); } -void WebRTCAudioDeviceTest::CreateChannel(const char* name) { +void MAYBE_WebRTCAudioDeviceTest::CreateChannel(const char* name) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); static const int kRenderProcessId = 1; @@ -256,7 +256,7 @@ void WebRTCAudioDeviceTest::CreateChannel(const char* name) { audio_input_renderer_host_->OnFilterAdded(channel_.get()); } -void WebRTCAudioDeviceTest::DestroyChannel() { +void MAYBE_WebRTCAudioDeviceTest::DestroyChannel() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); audio_render_host_->OnChannelClosing(); audio_render_host_->OnFilterRemoved(); @@ -267,7 +267,7 @@ void WebRTCAudioDeviceTest::DestroyChannel() { audio_input_renderer_host_ = NULL; } -void WebRTCAudioDeviceTest::OnGetAudioHardwareConfig( +void MAYBE_WebRTCAudioDeviceTest::OnGetAudioHardwareConfig( AudioParameters* input_params, AudioParameters* output_params) { ASSERT_TRUE(audio_hardware_config_); *input_params = audio_hardware_config_->GetInputConfig(); @@ -275,7 +275,8 @@ void WebRTCAudioDeviceTest::OnGetAudioHardwareConfig( } // IPC::Listener implementation. -bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { +bool MAYBE_WebRTCAudioDeviceTest::OnMessageReceived( + const IPC::Message& message) { if (render_thread_) { IPC::ChannelProxy::MessageFilter* filter = render_thread_->audio_input_message_filter(); @@ -301,7 +302,7 @@ bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { bool handled ALLOW_UNUSED = true; bool message_is_ok = true; - IPC_BEGIN_MESSAGE_MAP_EX(WebRTCAudioDeviceTest, message, message_is_ok) + IPC_BEGIN_MESSAGE_MAP_EX(MAYBE_WebRTCAudioDeviceTest, message, message_is_ok) IPC_MESSAGE_HANDLER(ViewHostMsg_GetAudioHardwareConfig, OnGetAudioHardwareConfig) IPC_MESSAGE_UNHANDLED(handled = false) @@ -313,17 +314,17 @@ bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { } // Posts a final task to the IO message loop and waits for completion. -void WebRTCAudioDeviceTest::WaitForIOThreadCompletion() { +void MAYBE_WebRTCAudioDeviceTest::WaitForIOThreadCompletion() { WaitForMessageLoopCompletion( ChildProcess::current()->io_message_loop()->message_loop_proxy().get()); } -void WebRTCAudioDeviceTest::WaitForAudioManagerCompletion() { +void MAYBE_WebRTCAudioDeviceTest::WaitForAudioManagerCompletion() { if (audio_manager_) WaitForMessageLoopCompletion(audio_manager_->GetMessageLoop().get()); } -void WebRTCAudioDeviceTest::WaitForMessageLoopCompletion( +void MAYBE_WebRTCAudioDeviceTest::WaitForMessageLoopCompletion( base::MessageLoopProxy* loop) { base::WaitableEvent* event = new base::WaitableEvent(false, false); loop->PostTask(FROM_HERE, base::Bind(&base::WaitableEvent::Signal, @@ -337,7 +338,7 @@ void WebRTCAudioDeviceTest::WaitForMessageLoopCompletion( } } -std::string WebRTCAudioDeviceTest::GetTestDataPath( +std::string MAYBE_WebRTCAudioDeviceTest::GetTestDataPath( const base::FilePath::StringType& file_name) { base::FilePath path; EXPECT_TRUE(PathService::Get(DIR_TEST_DATA, &path)); diff --git a/content/test/webrtc_audio_device_test.h b/content/test/webrtc_audio_device_test.h index a640e5c..b2fefaf 100644 --- a/content/test/webrtc_audio_device_test.h +++ b/content/test/webrtc_audio_device_test.h @@ -112,10 +112,19 @@ class WebRTCAutoDelete { // Implemented and defined in the cc file. class ReplaceContentClientRenderer; -class WebRTCAudioDeviceTest : public ::testing::Test, public IPC::Listener { +// Temporarily disabled in LeakSanitizer builds due to memory leaks. +// http://crbug.com/148865 +#if defined(LEAK_SANITIZER) +#define MAYBE_WebRTCAudioDeviceTest DISABLED_WebRTCAudioDeviceTest +#else +#define MAYBE_WebRTCAudioDeviceTest WebRTCAudioDeviceTest +#endif + +class MAYBE_WebRTCAudioDeviceTest : public ::testing::Test, + public IPC::Listener { public: - WebRTCAudioDeviceTest(); - virtual ~WebRTCAudioDeviceTest(); + MAYBE_WebRTCAudioDeviceTest(); + virtual ~MAYBE_WebRTCAudioDeviceTest(); virtual void SetUp() OVERRIDE; virtual void TearDown() OVERRIDE; |