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

Unified Diff: chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm

Issue 53116: Fix leaks found by valgrind (which now works on the Mac!)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « chrome/browser/cocoa/bookmark_menu_bridge.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm
===================================================================
--- chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm (revision 12575)
+++ chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm (working copy)
@@ -41,8 +41,8 @@
// Test that ClearBookmarkMenu() removes all bookmark menus.
TEST_F(BookmarkMenuBridgeTest, TestClearBookmarkMenu) {
- BookmarkMenuBridge* bridge = new BookmarkMenuBridge();
- EXPECT_TRUE(bridge);
+ scoped_ptr<BookmarkMenuBridge> bridge(new BookmarkMenuBridge());
+ EXPECT_TRUE(bridge.get());
NSMenu* menu = [[[NSMenu alloc] initWithTitle:@"foo"] autorelease];
@@ -53,7 +53,7 @@
AddItemToMenu(menu, @"not", @selector(openBookmarkMenuItem:));
AddItemToMenu(menu, @"zippy", @selector(length));
- ClearBookmarkMenu(bridge, menu);
+ ClearBookmarkMenu(bridge.get(), menu);
// Make sure all bookmark items are removed, and all items with
// submenus removed.
@@ -68,8 +68,8 @@
TEST_F(BookmarkMenuBridgeTest, TestAddNodeToMenu) {
Profile* profile = browser_test_helper_.GetProfile();
- BookmarkMenuBridge *bridge = new BookmarkMenuBridge();
- EXPECT_TRUE(bridge);
+ scoped_ptr<BookmarkMenuBridge> bridge(new BookmarkMenuBridge());
+ EXPECT_TRUE(bridge.get());
NSMenu* menu = [[[NSMenu alloc] initWithTitle:@"foo"] autorelease];
@@ -87,7 +87,7 @@
root->GetChild(1)->Add(0, node);
// Add to the NSMenu, then confirm it looks good
- AddNodeToMenu(bridge, root, menu);
+ AddNodeToMenu(bridge.get(), root, menu);
EXPECT_EQ(3, [menu numberOfItems]);
for (int x=0; x < 3; x++) {
« no previous file with comments | « chrome/browser/cocoa/bookmark_menu_bridge.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698