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

Unified Diff: chrome/browser/ui/cocoa/infobars/infobar_controller_unittest.mm

Issue 7981045: Make infobars ignore button clicks when closing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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
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_);

Powered by Google App Engine
This is Rietveld 408576698