| Index: chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm
|
| diff --git a/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm b/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm
|
| index 81e1ad807eb15ab4afacd51f23da9b217b11f19c..68fd18d31b8dabc9e5c89559d8de6eb89bed592e 100644
|
| --- a/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm
|
| +++ b/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm
|
| @@ -7,8 +7,8 @@
|
| #include "base/memory/scoped_nsobject.h"
|
| #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
|
| #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h"
|
| +#include "chrome/browser/ui/cocoa/infobars/mock_alternate_nav_infobar_delegate.h"
|
| #include "chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h"
|
| -#include "chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.h"
|
| #import "chrome/browser/ui/cocoa/view_resizer_pong.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "testing/platform_test.h"
|
| @@ -56,27 +56,30 @@ TEST_F(InfoBarContainerControllerTest, AddAndRemoveInfoBars) {
|
|
|
| // These delegates delete themselves when they're told their infobars have
|
| // closed.
|
| - InfoBarDelegate* linkDelegate = new MockLinkInfoBarDelegate(NULL);
|
| - InfoBarDelegate* linkDelegate2 = new MockLinkInfoBarDelegate(NULL);
|
| + InfoBarDelegate* alternateNavDelegate =
|
| + new MockAlternateNavInfoBarDelegate(NULL);
|
| + InfoBarDelegate* alternateNavDelegate2 =
|
| + new MockAlternateNavInfoBarDelegate(NULL);
|
| InfoBarDelegate* confirmDelegate = new MockConfirmInfoBarDelegate(NULL);
|
|
|
| - [controller_ addInfoBar:linkDelegate->CreateInfoBar(NULL) animate:NO];
|
| + [controller_ addInfoBar:alternateNavDelegate->CreateInfoBar(NULL) animate:NO];
|
| EXPECT_EQ(1U, [[view subviews] count]);
|
|
|
| [controller_ addInfoBar:confirmDelegate->CreateInfoBar(NULL) animate:NO];
|
| EXPECT_EQ(2U, [[view subviews] count]);
|
|
|
| - [controller_ addInfoBar:linkDelegate2->CreateInfoBar(NULL) animate:NO];
|
| + [controller_ addInfoBar:alternateNavDelegate2->CreateInfoBar(NULL)
|
| + animate:NO];
|
| EXPECT_EQ(3U, [[view subviews] count]);
|
|
|
| // Just to mix things up, remove them in a different order.
|
| [controller_ closeInfoBarsForDelegate:confirmDelegate animate:NO];
|
| EXPECT_EQ(2U, [[view subviews] count]);
|
|
|
| - [controller_ closeInfoBarsForDelegate:linkDelegate animate:NO];
|
| + [controller_ closeInfoBarsForDelegate:alternateNavDelegate animate:NO];
|
| EXPECT_EQ(1U, [[view subviews] count]);
|
|
|
| - [controller_ closeInfoBarsForDelegate:linkDelegate2 animate:NO];
|
| + [controller_ closeInfoBarsForDelegate:alternateNavDelegate2 animate:NO];
|
| EXPECT_EQ(0U, [[view subviews] count]);
|
| }
|
|
|
| @@ -87,14 +90,15 @@ TEST_F(InfoBarContainerControllerTest, RemoveAllInfoBars) {
|
|
|
| // removeAllInfobars does not close these, so we stack-allocate them so
|
| // they'll get cleaned up.
|
| - MockLinkInfoBarDelegate linkDelegate(NULL);
|
| + MockAlternateNavInfoBarDelegate alternateNavDelegate(NULL);
|
| MockConfirmInfoBarDelegate confirmDelegate(NULL);
|
| MockConfirmInfoBarDelegate confirmDelegate2(NULL);
|
| - InfoBarDelegate* linkDelegatePtr = &linkDelegate;
|
| + InfoBarDelegate* alternateNavDelegatePtr = &alternateNavDelegate;
|
| InfoBarDelegate* confirmDelegatePtr = &confirmDelegate;
|
| InfoBarDelegate* confirmDelegate2Ptr = &confirmDelegate2;
|
|
|
| - [controller_ addInfoBar:linkDelegatePtr->CreateInfoBar(NULL) animate:NO];
|
| + [controller_ addInfoBar:alternateNavDelegatePtr->CreateInfoBar(NULL)
|
| + animate:NO];
|
| [controller_ addInfoBar:confirmDelegatePtr->CreateInfoBar(NULL) animate:NO];
|
| [controller_ addInfoBar:confirmDelegate2Ptr->CreateInfoBar(NULL) animate:NO];
|
| EXPECT_EQ(3U, [[view subviews] count]);
|
|
|