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

Unified Diff: chrome/browser/extensions/api/browsing_data/browsing_data_test.cc

Issue 10825127: Valgrind: Clean up leaks in callers to extension_function_test_utils::RunFunction. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
Index: chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
===================================================================
--- chrome/browser/extensions/api/browsing_data/browsing_data_test.cc (revision 149361)
+++ chrome/browser/extensions/api/browsing_data/browsing_data_test.cc (working copy)
@@ -75,9 +75,11 @@
void RunRemoveBrowsingDataFunctionAndCompareRemovalMask(
const std::string& key,
int expected_mask) {
+ scoped_refptr<RemoveBrowsingDataFunction> function =
+ new RemoveBrowsingDataFunction();
SCOPED_TRACE(key);
EXPECT_EQ(NULL, RunFunctionAndReturnSingleResult(
- new RemoveBrowsingDataFunction(),
+ function.get(),
std::string("[{\"since\": 1}, {\"") + key + "\": true}]",
browser()));
EXPECT_EQ(expected_mask, GetRemovalMask());
@@ -87,9 +89,11 @@
void RunRemoveBrowsingDataFunctionAndCompareOriginSetMask(
const std::string& protectedStr,
int expected_mask) {
+ scoped_refptr<RemoveBrowsingDataFunction> function =
+ new RemoveBrowsingDataFunction();
SCOPED_TRACE(protectedStr);
EXPECT_EQ(NULL, RunFunctionAndReturnSingleResult(
- new RemoveBrowsingDataFunction(),
+ function.get(),
"[{\"originType\": " + protectedStr + "}, {\"cookies\": true}]",
browser()));
EXPECT_EQ(expected_mask, GetOriginSetMask());
@@ -104,11 +108,12 @@
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, OneAtATime) {
BrowsingDataRemover::set_removing(true);
+ scoped_refptr<RemoveBrowsingDataFunction> function =
+ new RemoveBrowsingDataFunction();
EXPECT_TRUE(MatchPattern(
- RunFunctionAndReturnError(
- new RemoveBrowsingDataFunction(),
- kRemoveEverythingArguments,
- browser()),
+ RunFunctionAndReturnError(function,
+ kRemoveEverythingArguments,
+ browser()),
extension_browsing_data_api_constants::kOneAtATimeError));
BrowsingDataRemover::set_removing(false);
@@ -119,10 +124,11 @@
// Use-after-free, see http://crbug.com/116522
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest,
DISABLED_RemoveBrowsingDataAll) {
- EXPECT_EQ(NULL, RunFunctionAndReturnSingleResult(
- new RemoveBrowsingDataFunction(),
- kRemoveEverythingArguments,
- browser()));
+ scoped_refptr<RemoveBrowsingDataFunction> function =
+ new RemoveBrowsingDataFunction();
+ EXPECT_EQ(NULL, RunFunctionAndReturnSingleResult(function.get(),
+ kRemoveEverythingArguments,
+ browser()));
EXPECT_EQ(base::Time::FromDoubleT(1.0), GetBeginTime());
EXPECT_EQ((BrowsingDataRemover::REMOVE_SITE_DATA |

Powered by Google App Engine
This is Rietveld 408576698