Skip to content

Commit

Permalink
Fix leaks in DragDownloadFile tests.
Browse files Browse the repository at this point in the history
Fix leaks in content_browsertests discovered by LeakSanitizer.

BUG=307043
R=benjhayden@chromium.org

Review URL: https://codereview.chromium.org/84103002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237065 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
earthdok@chromium.org committed Nov 25, 2013
1 parent ea67742 commit b3ac410
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions content/browser/download/drag_download_file_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,9 @@ IN_PROC_BROWSER_TEST_F(DragDownloadFileTest, DragDownloadFileTest_NetError) {
"download-test.lib"))));
Referrer referrer;
std::string referrer_encoding;
DragDownloadFile* file = new DragDownloadFile(name,
scoped_ptr<net::FileStream>(),
url,
referrer,
referrer_encoding,
shell()->web_contents());
scoped_refptr<DragDownloadFile> file(
new DragDownloadFile(name, scoped_ptr<net::FileStream>(), url, referrer,
referrer_encoding, shell()->web_contents()));
scoped_refptr<MockDownloadFileObserver> observer(
new MockDownloadFileObserver());
EXPECT_CALL(*observer.get(), OnDownloadAborted())
Expand All @@ -119,9 +116,9 @@ IN_PROC_BROWSER_TEST_F(DragDownloadFileTest, DragDownloadFileTest_Complete) {
std::string referrer_encoding;
net::FileStream* stream = NULL;
SetUpServer();
DragDownloadFile* file = new DragDownloadFile(
scoped_refptr<DragDownloadFile> file(new DragDownloadFile(
name, scoped_ptr<net::FileStream>(stream), url, referrer,
referrer_encoding, shell()->web_contents());
referrer_encoding, shell()->web_contents()));
scoped_refptr<MockDownloadFileObserver> observer(
new MockDownloadFileObserver());
EXPECT_CALL(*observer.get(), OnDownloadCompleted(_))
Expand Down

0 comments on commit b3ac410

Please sign in to comment.