Skip to content

Commit

Permalink
mac: Fix BookmarkBarControllerTest.TestClearOnDealloc on Yosemite.
Browse files Browse the repository at this point in the history
In Yosemite, the owner of a nib file is retain/autoreleased during the
initialization of the nib. I wrapped the constructor of the
BookmarkBarController in an @autoreleasepool block to allow the test to control
the destruction timing of the BookmarkBarController.

BUG=390276

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

Cr-Commit-Position: refs/heads/master@{#300312}
  • Loading branch information
erikchen authored and Commit bot committed Oct 20, 2014
1 parent 31111d1 commit 1124df6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,17 @@ virtual void SetUp() override {
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());
}
Expand Down

0 comments on commit 1124df6

Please sign in to comment.