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

Unified Diff: chrome/common/net/url_fetcher_unittest.cc

Issue 7051036: Fix memory leak in UrlFetcherTempFileTest.* tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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/net/url_fetcher_unittest.cc
diff --git a/chrome/common/net/url_fetcher_unittest.cc b/chrome/common/net/url_fetcher_unittest.cc
index 76265e8bd1dd1834291c81d7c7f95383b89eddc1..ae0b6e97c83bb378957d06e21178c7a0587094f1 100644
--- a/chrome/common/net/url_fetcher_unittest.cc
+++ b/chrome/common/net/url_fetcher_unittest.cc
@@ -357,13 +357,6 @@ TEST_F(URLFetcherTempFileTest, SmallGet) {
MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit().
- ASSERT_TRUE(file_util::PathExists(temp_file_))
- << temp_file_.value() << " not found.";
-
- // Deleting the fetcher should remove the file.
- delete fetcher_;
-
- MessageLoop::current()->RunAllPending();
ASSERT_FALSE(file_util::PathExists(temp_file_))
<< temp_file_.value() << " not removed.";
}
@@ -392,12 +385,6 @@ TEST_F(URLFetcherTempFileTest, CanTakeOwnershipOfFile) {
MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit().
- ASSERT_TRUE(file_util::PathExists(temp_file_))
- << temp_file_.value() << " not found.";
-
- // Deleting the fetcher should remove the file.
- delete fetcher_;
-
MessageLoop::current()->RunAllPending();
ASSERT_FALSE(file_util::PathExists(temp_file_))
<< temp_file_.value() << " not removed.";
@@ -646,6 +633,8 @@ void URLFetcherTempFileTest::OnURLFetchComplete(const URLFetcher* source) {
EXPECT_TRUE(file_util::ContentsEqual(expected_file_, temp_file_));
+ delete fetcher_;
+
io_message_loop_proxy()->PostTask(FROM_HERE, new MessageLoop::QuitTask());
}
« 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