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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm

Issue 660063004: mac: Fix BookmarkBarControllerTest.TestClearOnDealloc on Yosemite. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years, 2 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/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());
}
« 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