summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-20 18:15:24 +0000
committeryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-20 18:15:24 +0000
commit792431fdd053b8f1b3793bfe1eef3001aecaad27 (patch)
tree66d9c240ed5f625326083c0f47cc366a4ef40809
parent37f5b87b2be729bee4b64849b5d894a48fd9dd57 (diff)
downloadchromium_src-792431fdd053b8f1b3793bfe1eef3001aecaad27.zip
chromium_src-792431fdd053b8f1b3793bfe1eef3001aecaad27.tar.gz
chromium_src-792431fdd053b8f1b3793bfe1eef3001aecaad27.tar.bz2
Fix leak in ExtensionSyncTypeTest.
BUG=262096 Review URL: https://chromiumcodereview.appspot.com/19881002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212796 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/sync_type_unittest.cc15
-rw-r--r--tools/heapcheck/suppressions.txt6
-rw-r--r--tools/valgrind/memcheck/suppressions.txt7
3 files changed, 8 insertions, 20 deletions
diff --git a/chrome/common/extensions/sync_type_unittest.cc b/chrome/common/extensions/sync_type_unittest.cc
index 3380a05..22678e9 100644
--- a/chrome/common/extensions/sync_type_unittest.cc
+++ b/chrome/common/extensions/sync_type_unittest.cc
@@ -51,14 +51,15 @@ class ExtensionSyncTypeTest : public testing::Test {
}
if (type != THEME) {
source.SetBoolean(keys::kConvertedFromUserScript, type == USER_SCRIPT);
- base::ListValue* plugins = new base::ListValue();
- for (int i = 0; i < num_plugins; ++i) {
- base::DictionaryValue* plugin = new base::DictionaryValue();
- plugin->SetString(keys::kPluginsPath, std::string());
- plugins->Set(i, plugin);
- }
- if (num_plugins >= 0)
+ if (num_plugins >= 0) {
+ base::ListValue* plugins = new base::ListValue();
+ for (int i = 0; i < num_plugins; ++i) {
+ base::DictionaryValue* plugin = new base::DictionaryValue();
+ plugin->SetString(keys::kPluginsPath, std::string());
+ plugins->Set(i, plugin);
+ }
source.Set(keys::kPlugins, plugins);
+ }
}
if (has_plugin_permission) {
ListValue* plugins = new ListValue();
diff --git a/tools/heapcheck/suppressions.txt b/tools/heapcheck/suppressions.txt
index f0686a7..2716073 100644
--- a/tools/heapcheck/suppressions.txt
+++ b/tools/heapcheck/suppressions.txt
@@ -1063,9 +1063,3 @@
fun:~MessageLoop
fun:~StorageMonitorLinuxTest
}
-{
- bug_262096
- Heapcheck:Leak
- fun:extensions::ExtensionSyncTypeTest::MakeSyncTestExtensionWithPluginPermission
- fun:extensions::ExtensionSyncTypeTest::MakeSyncTestExtension
-}
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index 6865ae3..3aea40a 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -7347,10 +7347,3 @@
fun:_ZN7WebCore13TypingCommand28insertTextRunWithoutNewlinesERKN3WTF6StringEb
fun:_ZNK7WebCore26TypingCommandLineOperationclEmmb
}
-{
- bug_262096
- Memcheck:Leak
- fun:_Znw*
- fun:_ZN10extensions21ExtensionSyncTypeTest41MakeSyncTestExtensionWithPluginPermissionENS0_21SyncTestExtensionTypeERK4GURLS4_NS_8Manifest8LocationERKN4base8FilePathEiibRKSs
- fun:_ZN10extensions21ExtensionSyncTypeTest21MakeSyncTestExtensionENS0_21SyncTestExtensionTypeERK4GURLS4_NS_8Manifest8LocationERKN4base8FilePathEi
-}