From f30158050f9ca26d9df35964e6f9501e1616aac5 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Thu, 10 Sep 2009 18:25:50 +0000 Subject: Attempt to fix memory leak in some mac tests. Review URL: http://codereview.chromium.org/192061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25884 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/download_util_mac_unittest.mm | 2 ++ chrome/browser/cocoa/web_drop_target_unittest.mm | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/chrome/browser/cocoa/download_util_mac_unittest.mm b/chrome/browser/cocoa/download_util_mac_unittest.mm index 4369275..0f61704 100644 --- a/chrome/browser/cocoa/download_util_mac_unittest.mm +++ b/chrome/browser/cocoa/download_util_mac_unittest.mm @@ -44,6 +44,8 @@ TEST_F(DownloadUtilTest, AddFileToPasteboardTest) { NSString* expectedPath = [files objectAtIndex:0]; NSString* realPath = base::SysWideToNSString(testPath.ToWStringHack()); EXPECT_TRUE([expectedPath isEqualToString:realPath]); + + [pasteboard releaseGlobally]; } } // namespace diff --git a/chrome/browser/cocoa/web_drop_target_unittest.mm b/chrome/browser/cocoa/web_drop_target_unittest.mm index c1f174c..7dd02de 100644 --- a/chrome/browser/cocoa/web_drop_target_unittest.mm +++ b/chrome/browser/cocoa/web_drop_target_unittest.mm @@ -66,6 +66,7 @@ TEST_F(WebDropTargetTest, URL) { PutURLOnPasteboard(@"http://www.google.com", pboard); [drop_target_ populateURLAndTitle:&data fromPasteboard:pboard]; EXPECT_EQ(data.url.spec(), "http://www.google.com/"); + [pboard releaseGlobally]; // Put a 'url ' and 'urln' on the pasteboard and check it. NSString* title = @"Title of Awesomeness!"; @@ -80,6 +81,8 @@ TEST_F(WebDropTargetTest, URL) { [drop_target_ populateURLAndTitle:&data fromPasteboard:pboard]; EXPECT_EQ(data.url.spec(), "http://www.something.com/"); EXPECT_EQ(data.url_title, base::SysNSStringToUTF16(title)); + + [pboard releaseGlobally]; } TEST_F(WebDropTargetTest, Data) { @@ -98,6 +101,8 @@ TEST_F(WebDropTargetTest, Data) { EXPECT_EQ(data.url.spec(), "http://www.google.com/"); EXPECT_EQ(data.plain_text, base::SysNSStringToUTF16(textString)); EXPECT_EQ(data.text_html, base::SysNSStringToUTF16(htmlString)); + + [pboard releaseGlobally]; } TEST_F(WebDropTargetTest, EnterExitDrop) { -- cgit v1.1