Chromium Code Reviews| Index: chrome/browser/notifications/notification_browsertest.cc |
| diff --git a/chrome/browser/notifications/notification_browsertest.cc b/chrome/browser/notifications/notification_browsertest.cc |
| index 4f2944341785d6bf9322d9a8cd57384b19654c15..50181541aa67b12043e2a492b748f810865f2d08 100644 |
| --- a/chrome/browser/notifications/notification_browsertest.cc |
| +++ b/chrome/browser/notifications/notification_browsertest.cc |
| @@ -17,6 +17,7 @@ |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
| #include "chrome/browser/infobars/infobar.h" |
| +#include "chrome/browser/infobars/infobar_manager.h" |
| #include "chrome/browser/infobars/infobar_service.h" |
| #include "chrome/browser/notifications/balloon.h" |
| #include "chrome/browser/notifications/balloon_collection.h" |
| @@ -318,10 +319,11 @@ void NotificationsTest::AllowAllOrigins() { |
| void NotificationsTest::VerifyInfoBar(const Browser* browser, int index) { |
| InfoBarService* infobar_service = InfoBarService::FromWebContents( |
| browser->tab_strip_model()->GetWebContentsAt(index)); |
| + InfoBarManager& infobar_manager = infobar_service->infobar_manager(); |
| - ASSERT_EQ(1U, infobar_service->infobar_count()); |
| + ASSERT_EQ(1U, infobar_manager.infobar_count()); |
| ConfirmInfoBarDelegate* confirm_infobar = |
| - infobar_service->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate(); |
| + infobar_manager.infobar_at(0)->delegate()->AsConfirmInfoBarDelegate(); |
| ASSERT_TRUE(confirm_infobar); |
| int buttons = confirm_infobar->GetButtons(); |
| EXPECT_TRUE(buttons & ConfirmInfoBarDelegate::BUTTON_OK); |
| @@ -402,17 +404,18 @@ bool NotificationsTest::PerformActionOnInfoBar( |
| int tab_index) { |
| InfoBarService* infobar_service = InfoBarService::FromWebContents( |
| browser->tab_strip_model()->GetWebContentsAt(tab_index)); |
| - if (infobar_index >= infobar_service->infobar_count()) { |
| + InfoBarManager& infobar_manager = infobar_service->infobar_manager(); |
| + if (infobar_index >= infobar_manager.infobar_count()) { |
| ADD_FAILURE(); |
| return false; |
| } |
| - InfoBar* infobar = infobar_service->infobar_at(infobar_index); |
| + InfoBar* infobar = infobar_manager.infobar_at(infobar_index); |
| InfoBarDelegate* infobar_delegate = infobar->delegate(); |
| switch (action) { |
| case DISMISS: |
| infobar_delegate->InfoBarDismissed(); |
| - infobar_service->RemoveInfoBar(infobar); |
| + infobar_manager.RemoveInfoBar(infobar); |
| return true; |
| case ALLOW: { |
| @@ -421,7 +424,7 @@ bool NotificationsTest::PerformActionOnInfoBar( |
| if (!confirm_infobar_delegate) { |
| ADD_FAILURE(); |
| } else if (confirm_infobar_delegate->Accept()) { |
| - infobar_service->RemoveInfoBar(infobar); |
| + infobar_manager.RemoveInfoBar(infobar); |
| return true; |
| } |
| } |
| @@ -432,7 +435,7 @@ bool NotificationsTest::PerformActionOnInfoBar( |
| if (!confirm_infobar_delegate) { |
| ADD_FAILURE(); |
| } else if (confirm_infobar_delegate->Cancel()) { |
| - infobar_service->RemoveInfoBar(infobar); |
| + infobar_manager.RemoveInfoBar(infobar); |
| return true; |
| } |
| } |
| @@ -496,8 +499,11 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestUserGestureInfobar) { |
| &result)); |
| EXPECT_TRUE(result); |
| - EXPECT_EQ(1U, InfoBarService::FromWebContents( |
| - browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count()); |
| + EXPECT_EQ(1U, |
| + InfoBarService::FromWebContents( |
| + browser()->tab_strip_model()->GetWebContentsAt(0)) |
| + ->infobar_manager() |
| + .infobar_count()); |
|
blundell
2014/03/27 09:40:30
This indentation seems odd (and below)
|
| } |
| // If this flakes, use http://crbug.com/62311. |
| @@ -511,8 +517,11 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNoUserGestureInfobar) { |
| embedded_test_server()->GetURL( |
| "/notifications/notifications_request_inline.html")); |
| - EXPECT_EQ(0U, InfoBarService::FromWebContents( |
| - browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count()); |
| + EXPECT_EQ(0U, |
| + InfoBarService::FromWebContents( |
| + browser()->tab_strip_model()->GetWebContentsAt(0)) |
| + ->infobar_manager() |
| + .infobar_count()); |
| } |
| IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCreateSimpleNotification) { |
| @@ -652,8 +661,9 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestAllowNotificationsFromAllSites) { |
| EXPECT_NE("-1", result); |
| ASSERT_EQ(1, GetNotificationCount()); |
| - EXPECT_EQ(0U, InfoBarService::FromWebContents( |
| - browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count()); |
| + InfoBarService* infobar_service = InfoBarService::FromWebContents( |
| + browser()->tab_strip_model()->GetWebContentsAt(0)); |
| + EXPECT_EQ(0U, infobar_service->infobar_manager().infobar_count()); |
| } |
| IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyNotificationsFromAllSites) { |
| @@ -719,8 +729,9 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyAndThenAllowDomain) { |
| EXPECT_NE("-1", result); |
| ASSERT_EQ(1, GetNotificationCount()); |
| - EXPECT_EQ(0U, InfoBarService::FromWebContents( |
| - browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count()); |
| + InfoBarService* infobar_service = InfoBarService::FromWebContents( |
| + browser()->tab_strip_model()->GetWebContentsAt(0)); |
| + EXPECT_EQ(0U, infobar_service->infobar_manager().infobar_count()); |
| } |
| IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCreateDenyCloseNotifications) { |