| Index: chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm
|
| ===================================================================
|
| --- chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm (revision 72676)
|
| +++ chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm (working copy)
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -49,44 +49,42 @@
|
| TEST_F(InfoBarContainerControllerTest, AddAndRemoveInfoBars) {
|
| NSView* view = [controller_ view];
|
|
|
| - // Add three infobars, one of each type, and then remove them.
|
| + // Add three infobars and then remove them.
|
| // After each step check to make sure we have the correct number of
|
| // infobar subviews.
|
| - MockAlertInfoBarDelegate alertDelegate;
|
| - MockLinkInfoBarDelegate linkDelegate;
|
| + MockLinkInfoBarDelegate linkDelegate, linkDelegate2;
|
| MockConfirmInfoBarDelegate confirmDelegate;
|
|
|
| - [controller_ addInfoBar:&alertDelegate animate:NO];
|
| + [controller_ addInfoBar:&linkDelegate animate:NO];
|
| EXPECT_EQ(1U, [[view subviews] count]);
|
|
|
| - [controller_ addInfoBar:&linkDelegate animate:NO];
|
| + [controller_ addInfoBar:&confirmDelegate animate:NO];
|
| EXPECT_EQ(2U, [[view subviews] count]);
|
|
|
| - [controller_ addInfoBar:&confirmDelegate animate:NO];
|
| + [controller_ addInfoBar:&linkDelegate2 animate:NO];
|
| EXPECT_EQ(3U, [[view subviews] count]);
|
|
|
| // Just to mix things up, remove them in a different order.
|
| - [controller_ closeInfoBarsForDelegate:&linkDelegate animate:NO];
|
| + [controller_ closeInfoBarsForDelegate:&confirmDelegate animate:NO];
|
| EXPECT_EQ(2U, [[view subviews] count]);
|
|
|
| - [controller_ closeInfoBarsForDelegate:&confirmDelegate animate:NO];
|
| + [controller_ closeInfoBarsForDelegate:&linkDelegate animate:NO];
|
| EXPECT_EQ(1U, [[view subviews] count]);
|
|
|
| - [controller_ closeInfoBarsForDelegate:&alertDelegate animate:NO];
|
| - EXPECT_EQ(0U, [[view subviews] count]);
|
| + [controller_ closeInfoBarsForDelegate:&linkDelegate2 animate:NO];
|
| + EXPECT_EQ(1U, [[view subviews] count]);
|
| }
|
|
|
| TEST_F(InfoBarContainerControllerTest, RemoveAllInfoBars) {
|
| NSView* view = [controller_ view];
|
|
|
| // Add three infobars and then remove them all.
|
| - MockAlertInfoBarDelegate alertDelegate;
|
| MockLinkInfoBarDelegate linkDelegate;
|
| - MockConfirmInfoBarDelegate confirmDelegate;
|
| + MockConfirmInfoBarDelegate confirmDelegate, confirmDelegate2;
|
|
|
| - [controller_ addInfoBar:&alertDelegate animate:NO];
|
| [controller_ addInfoBar:&linkDelegate animate:NO];
|
| [controller_ addInfoBar:&confirmDelegate animate:NO];
|
| + [controller_ addInfoBar:&confirmDelegate2 animate:NO];
|
| EXPECT_EQ(3U, [[view subviews] count]);
|
|
|
| [controller_ removeAllInfoBars];
|
|
|