Index: chrome/browser/ui/cocoa/infobars/infobar_controller_unittest.mm |
=================================================================== |
--- chrome/browser/ui/cocoa/infobars/infobar_controller_unittest.mm (revision 102604) |
+++ chrome/browser/ui/cocoa/infobars/infobar_controller_unittest.mm (working copy) |
@@ -90,15 +90,19 @@ |
// Test fixtures |
class LinkInfoBarControllerTest : public CocoaTest, |
+ public TabContentsWrapperTestHarness, |
public MockLinkInfoBarDelegate::Owner { |
public: |
+ LinkInfoBarControllerTest() { |
+ contents_wrapper()->infobar_tab_helper()->set_infobars_enabled(false); |
+ } |
virtual void SetUp() { |
CocoaTest::SetUp(); |
delegate_ = new MockLinkInfoBarDelegate(this); |
- controller_.reset( |
- [[TestLinkInfoBarController alloc] initWithDelegate:delegate_ |
- owner:NULL]); |
+ controller_.reset([[TestLinkInfoBarController alloc] |
+ initWithDelegate:delegate_ |
+ owner:contents_wrapper()]); |
container_.reset( |
[[InfoBarContainerTest alloc] initWithController:controller_]); |
[controller_ setContainerController:container_]; |
@@ -129,15 +133,19 @@ |
}; |
class ConfirmInfoBarControllerTest : public CocoaTest, |
+ public TabContentsWrapperTestHarness, |
public MockConfirmInfoBarDelegate::Owner { |
public: |
+ ConfirmInfoBarControllerTest() { |
+ contents_wrapper()->infobar_tab_helper()->set_infobars_enabled(false); |
+ } |
virtual void SetUp() { |
CocoaTest::SetUp(); |
delegate_ = new MockConfirmInfoBarDelegate(this); |
- controller_.reset( |
- [[TestConfirmInfoBarController alloc] initWithDelegate:delegate_ |
- owner:NULL]); |
+ controller_.reset([[TestConfirmInfoBarController alloc] |
+ initWithDelegate:delegate_ |
+ owner:contents_wrapper()]); |
container_.reset( |
[[InfoBarContainerTest alloc] initWithController:controller_]); |
[controller_ setContainerController:container_]; |
@@ -186,7 +194,7 @@ |
EXPECT_TRUE(delegate_->icon_accessed()); |
// Check that dismissing the infobar deletes the delegate. |
- [controller_ dismiss:nil]; |
+ [controller_ removeSelf]; |
ASSERT_TRUE(delegate_closed()); |
EXPECT_FALSE(closed_delegate_link_clicked_); |
} |
@@ -233,7 +241,7 @@ |
base::SysNSStringToUTF8([controller_.get() labelString])); |
// Check that dismissing the infobar deletes the delegate. |
- [controller_ dismiss:nil]; |
+ [controller_ removeSelf]; |
ASSERT_TRUE(delegate_closed()); |
EXPECT_FALSE(closed_delegate_ok_clicked_); |
EXPECT_FALSE(closed_delegate_cancel_clicked_); |