Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4209)

Unified Diff: chrome/common/extensions/command_unittest.cc

Issue 493903003: Fix a leak in a test from r291170. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/command_unittest.cc
diff --git a/chrome/common/extensions/command_unittest.cc b/chrome/common/extensions/command_unittest.cc
index a52f064a0497c182d02deea20689cf7402d457d5..795fb03f4f27d6855d23ac4acc445e3bfcac42d2 100644
--- a/chrome/common/extensions/command_unittest.cc
+++ b/chrome/common/extensions/command_unittest.cc
@@ -56,12 +56,6 @@ void CheckParse(ConstCommandsTestData data,
// Now, test the parse of a platform dictionary suggested_key value.
if (data.key[0] != '\0') {
- input.reset(new base::DictionaryValue);
- base::DictionaryValue* key_dict = new base::DictionaryValue();
-
- for (size_t j = 0; j < platforms.size(); ++j)
- key_dict->SetString(platforms[j], data.key);
-
std::string current_platform = extensions::Command::CommandPlatform();
if (platform_specific_only &&
std::find(platforms.begin(), platforms.end(), current_platform) ==
@@ -72,6 +66,12 @@ void CheckParse(ConstCommandsTestData data,
return;
}
+ input.reset(new base::DictionaryValue);
+ base::DictionaryValue* key_dict = new base::DictionaryValue();
+
+ for (size_t j = 0; j < platforms.size(); ++j)
+ key_dict->SetString(platforms[j], data.key);
+
input->Set("suggested_key", key_dict);
input->SetString("description", data.description);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698