Commit 1124df6b authored by erikchen's avatar erikchen Committed by Commit bot

mac: Fix BookmarkBarControllerTest.TestClearOnDealloc on Yosemite.

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}
parent 31111d18
......@@ -348,12 +348,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());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment