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

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

Issue 7006010: Change InfoBar-related notifications to be sourced from a TabContentsWrapper, not a TabContents. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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_container_controller_unittest.mm
===================================================================
--- chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm (revision 87541)
+++ chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm (working copy)
@@ -56,18 +56,23 @@
// These delegates delete themselves when they're told their infobars have
// closed.
- MockLinkInfoBarDelegate* linkDelegate = new MockLinkInfoBarDelegate(NULL);
- MockLinkInfoBarDelegate* linkDelegate2 = new MockLinkInfoBarDelegate(NULL);
- MockConfirmInfoBarDelegate* confirmDelegate =
- new MockConfirmInfoBarDelegate(NULL);
+ InfoBarDelegate* linkDelegate = new MockLinkInfoBarDelegate(NULL);
+ InfoBarDelegate* linkDelegate2 = new MockLinkInfoBarDelegate(NULL);
+ InfoBarDelegate* confirmDelegate = new MockConfirmInfoBarDelegate(NULL);
- [controller_ addInfoBar:linkDelegate animate:NO];
+ [controller_ addInfoBar:linkDelegate->CreateInfoBar(NULL)
+ animate:NO
+ deleteImmediately:YES];
EXPECT_EQ(1U, [[view subviews] count]);
- [controller_ addInfoBar:confirmDelegate animate:NO];
+ [controller_ addInfoBar:confirmDelegate->CreateInfoBar(NULL)
+ animate:NO
+ deleteImmediately:YES];
EXPECT_EQ(2U, [[view subviews] count]);
- [controller_ addInfoBar:linkDelegate2 animate:NO];
+ [controller_ addInfoBar:linkDelegate2->CreateInfoBar(NULL)
+ animate:NO
+ deleteImmediately:YES];
EXPECT_EQ(3U, [[view subviews] count]);
// Just to mix things up, remove them in a different order.
@@ -91,10 +96,19 @@
MockLinkInfoBarDelegate linkDelegate(NULL);
MockConfirmInfoBarDelegate confirmDelegate(NULL);
MockConfirmInfoBarDelegate confirmDelegate2(NULL);
+ InfoBarDelegate* linkDelegatePtr = &linkDelegate;
+ InfoBarDelegate* confirmDelegatePtr = &confirmDelegate;
+ InfoBarDelegate* confirmDelegate2Ptr = &confirmDelegate2;
- [controller_ addInfoBar:&linkDelegate animate:NO];
- [controller_ addInfoBar:&confirmDelegate animate:NO];
- [controller_ addInfoBar:&confirmDelegate2 animate:NO];
+ [controller_ addInfoBar:linkDelegatePtr->CreateInfoBar(NULL)
+ animate:NO
+ deleteImmediately:YES];
+ [controller_ addInfoBar:confirmDelegatePtr->CreateInfoBar(NULL)
+ animate:NO
+ deleteImmediately:YES];
+ [controller_ addInfoBar:confirmDelegate2Ptr->CreateInfoBar(NULL)
+ animate:NO
+ deleteImmediately:YES];
EXPECT_EQ(3U, [[view subviews] count]);
[controller_ removeAllInfoBars];

Powered by Google App Engine
This is Rietveld 408576698