diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-21 20:34:26 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-21 20:34:26 +0000 |
commit | 718eb087d45506befae5ecdc3fae1296c988d194 (patch) | |
tree | 58309acc9353e89cef148574820e6ff0a47ddaa6 /chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm | |
parent | 1f14a913d60da63f3e4eb73cf4dea134e1ec75d0 (diff) | |
download | chromium_src-718eb087d45506befae5ecdc3fae1296c988d194.zip chromium_src-718eb087d45506befae5ecdc3fae1296c988d194.tar.gz chromium_src-718eb087d45506befae5ecdc3fae1296c988d194.tar.bz2 |
Fix some valgrind failures.
BUG=http://crbug.com/18158, http://crbug.com/30381, http://crbug.com/30371, http://crbug.com/30373
TEST=valgrind bots green. Bookmark bubble still works.
Review URL: http://codereview.chromium.org/503064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm')
-rw-r--r-- | chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm index a053140..c98b93d 100644 --- a/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm +++ b/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm @@ -27,14 +27,17 @@ class BookmarkBubbleControllerTest : public CocoaTest { virtual void TearDown() { [controller_ close]; + controller_ = nil; CocoaTest::TearDown(); } // Returns a controller but ownership not transferred. // Only one of these will be valid at a time. BookmarkBubbleController* ControllerForNode(const BookmarkNode* node) { - if (controller_) + if (controller_ && !IsWindowClosing()) { [controller_ close]; + controller_ = nil; + } controller_ = [[BookmarkBubbleController alloc] initWithParentWindow:test_window() topLeftForBubble:TopLeftForBubble() @@ -42,6 +45,8 @@ class BookmarkBubbleControllerTest : public CocoaTest { node:node alreadyBookmarked:YES]; EXPECT_TRUE([controller_ window]); + // The window must be gone or we'll fail a unit test with windows left open. + [static_cast<InfoBubbleWindow*>([controller_ window]) setDelayOnClose:NO]; [controller_ showWindow:nil]; return controller_; } |