Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm |
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm |
index 688c7ba4a2a1c51417ae06340fdcc8538ea3ea07..09b85719f397440aa231bcc4c9173b771317987a 100644 |
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm |
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm |
@@ -347,12 +347,17 @@ class BookmarkBarControllerTest : public BookmarkBarControllerTestBase { |
ASSERT_TRUE(browser()); |
AddCommandLineSwitches(); |
- bar_.reset( |
- [[BookmarkBarControllerNoOpen alloc] |
+ // In OSX 10.10, the owner of a nib file is retain/autoreleased during the |
+ // initialization of the nib. Wrapping the constructor in an |
+ // autoreleasepool ensures that tests can control the destruction timing of |
+ // |bar_|. |
+ @autoreleasepool { |
+ bar_.reset([[BookmarkBarControllerNoOpen alloc] |
initWithBrowser:browser() |
initialWidth:NSWidth([parent_view_ frame]) |
delegate:nil |
resizeDelegate:resizeDelegate_.get()]); |
+ } |
InstallAndToggleBar(bar_.get()); |
} |