summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcira@google.com <cira@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 22:06:53 +0000
committercira@google.com <cira@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 22:06:53 +0000
commit4bb80764b3e2f3540c5bf8e1bb0efd9b0613e82b (patch)
tree554b355f0516f33c8dc200bb3d675190b6cf9c18
parent2597381b07036e7d6e0773c8195a3dab7ef1240c (diff)
downloadchromium_src-4bb80764b3e2f3540c5bf8e1bb0efd9b0613e82b.zip
chromium_src-4bb80764b3e2f3540c5bf8e1bb0efd9b0613e82b.tar.gz
chromium_src-4bb80764b3e2f3540c5bf8e1bb0efd9b0613e82b.tar.bz2
Fix valgrind problem with the tests, remove suppresions.
TEST=Run tests under valgrind - no errors. BUG=35367 Review URL: http://codereview.chromium.org/606001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38832 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/extension_l10n_util_unittest.cc4
-rw-r--r--chrome/common/extensions/extension_message_filter_peer_unittest.cc14
-rw-r--r--tools/valgrind/memcheck/suppressions.txt29
3 files changed, 16 insertions, 31 deletions
diff --git a/chrome/common/extensions/extension_l10n_util_unittest.cc b/chrome/common/extensions/extension_l10n_util_unittest.cc
index 278a4ed..3fb2f7a 100644
--- a/chrome/common/extensions/extension_l10n_util_unittest.cc
+++ b/chrome/common/extensions/extension_l10n_util_unittest.cc
@@ -417,18 +417,20 @@ class ApplyMessageFilterPolicyTest : public testing::Test {
url_.reset(new GURL(
"chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/popup.html"));
resource_type_ = ResourceType::STYLESHEET;
+ resource_handler_.reset(new DummyResourceHandler());
request_info_.reset(CreateNewResourceRequestInfo());
}
ResourceDispatcherHostRequestInfo* CreateNewResourceRequestInfo() {
return new ResourceDispatcherHostRequestInfo(
- new DummyResourceHandler(), ChildProcessInfo::RENDER_PROCESS, 0, 0, 0,
+ resource_handler_.get(), ChildProcessInfo::RENDER_PROCESS, 0, 0, 0,
"not important", "not important",
ResourceType::STYLESHEET, 0U, false, false, -1, -1);
}
scoped_ptr<GURL> url_;
ResourceType::Type resource_type_;
+ scoped_ptr<DummyResourceHandler> resource_handler_;
scoped_ptr<ResourceDispatcherHostRequestInfo> request_info_;
};
diff --git a/chrome/common/extensions/extension_message_filter_peer_unittest.cc b/chrome/common/extensions/extension_message_filter_peer_unittest.cc
index f0a73d7..cf7d10f 100644
--- a/chrome/common/extensions/extension_message_filter_peer_unittest.cc
+++ b/chrome/common/extensions/extension_message_filter_peer_unittest.cc
@@ -10,6 +10,7 @@
#include "chrome/common/extensions/extension_message_filter_peer.h"
#include "chrome/common/filter_policy.h"
#include "ipc/ipc_message.h"
+#include "ipc/ipc_sync_message.h"
#include "net/base/net_errors.h"
#include "net/url_request/url_request_status.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -17,6 +18,8 @@
#include "webkit/glue/resource_loader_bridge.h"
using testing::_;
+using testing::DoAll;
+using testing::Invoke;
using testing::StrEq;
using testing::Return;
@@ -29,9 +32,18 @@ static const char* const kExtensionUrl_2 =
static const char* const kExtensionUrl_3 =
"chrome-extension://some_id3/popup.css";
+void MessageDeleter(IPC::Message* message) {
+ delete static_cast<IPC::SyncMessage*>(message)->GetReplyDeserializer();
+ delete message;
+}
+
class MockIpcMessageSender : public IPC::Message::Sender {
public:
- MockIpcMessageSender() {}
+ MockIpcMessageSender() {
+ ON_CALL(*this, Send(_))
+ .WillByDefault(DoAll(Invoke(MessageDeleter), Return(true)));
+ }
+
virtual ~MockIpcMessageSender() {}
MOCK_METHOD1(Send, bool(IPC::Message* message));
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index e3f4602..0466620 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -2323,35 +2323,6 @@
fun:_ZN11MessageLoop10RunHandlerEv
}
{
- bug_35367a
- Memcheck:Leak
- fun:_Znw*
- fun:_ZN26ExtensionMessageFilterPeer15ReplaceMessagesEv
- fun:_ZN26ExtensionMessageFilterPeer18OnCompletedRequestERK16URLRequestStatusRKSs
- fun:_ZN64ExtensionMessageFilterPeerTest_OnCompletedRequestNoCatalogs_Test8TestBodyEv
- fun:_ZN7testing4Test3RunEv
- fun:_ZN7testing8internal12TestInfoImpl3RunEv
- fun:_ZN7testing8TestCase3RunEv
- fun:_ZN7testing8internal12UnitTestImpl11RunAllTestsEv
- fun:_ZN7testing8UnitTest3RunEv
- fun:_ZN9TestSuite3RunEv
- fun:main
-}
-{
- bug_35367b
- Memcheck:Leak
- fun:_Znw*
- fun:*ApplyMessageFilterPolicyTest28CreateNewResourceRequestInfoEv
- fun:*ApplyMessageFilterPolicyTest5SetUpEv
- fun:_ZN7testing4Test3RunEv
- fun:_ZN7testing8internal12TestInfoImpl3RunEv
- fun:_ZN7testing8TestCase3RunEv
- fun:_ZN7testing8internal12UnitTestImpl11RunAllTestsEv
- fun:_ZN7testing8UnitTest3RunEv
- fun:_ZN9TestSuite3RunEv
- fun:main
-}
-{
bug_35436
Memcheck:Addr4
fun:CERT_PKIXVerifyCert