| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/scoped_nsautorelease_pool.h" | 7 #include "base/scoped_nsautorelease_pool.h" |
| 8 #include "base/scoped_nsobject.h" | 8 #include "base/scoped_nsobject.h" |
| 9 #include "chrome/browser/cocoa/browser_test_helper.h" | 9 #include "chrome/browser/cocoa/browser_test_helper.h" |
| 10 #import "chrome/browser/cocoa/cocoa_test_helper.h" | 10 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
| 11 #import "chrome/browser/cocoa/infobar_container_controller.h" | 11 #import "chrome/browser/cocoa/infobar_container_controller.h" |
| 12 #include "chrome/browser/cocoa/infobar_test_helper.h" | 12 #include "chrome/browser/cocoa/infobar_test_helper.h" |
| 13 #import "chrome/browser/cocoa/view_resizer_pong.h" | 13 #import "chrome/browser/cocoa/view_resizer_pong.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "testing/platform_test.h" |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 class InfoBarContainerControllerTest : public testing::Test { | 19 class InfoBarContainerControllerTest : public PlatformTest { |
| 19 virtual void SetUp() { | 20 virtual void SetUp() { |
| 20 resizeDelegate_.reset([[ViewResizerPong alloc] init]); | 21 resizeDelegate_.reset([[ViewResizerPong alloc] init]); |
| 21 TabStripModel* model = browser_helper_.browser()->tabstrip_model(); | 22 TabStripModel* model = browser_helper_.browser()->tabstrip_model(); |
| 22 controller_.reset([[InfoBarContainerController alloc] | 23 controller_.reset([[InfoBarContainerController alloc] |
| 23 initWithTabStripModel:model | 24 initWithTabStripModel:model |
| 24 resizeDelegate:resizeDelegate_.get()]); | 25 resizeDelegate:resizeDelegate_.get()]); |
| 25 } | 26 } |
| 26 | 27 |
| 27 public: | 28 public: |
| 28 // Order is very important here. We want the controller deleted | 29 // Order is very important here. We want the controller deleted |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 94 |
| 94 [controller_ addInfoBar:&alertDelegate]; | 95 [controller_ addInfoBar:&alertDelegate]; |
| 95 [controller_ addInfoBar:&linkDelegate]; | 96 [controller_ addInfoBar:&linkDelegate]; |
| 96 [controller_ addInfoBar:&confirmDelegate]; | 97 [controller_ addInfoBar:&confirmDelegate]; |
| 97 EXPECT_EQ(3U, [[view subviews] count]); | 98 EXPECT_EQ(3U, [[view subviews] count]); |
| 98 | 99 |
| 99 [controller_ removeAllInfoBars]; | 100 [controller_ removeAllInfoBars]; |
| 100 EXPECT_EQ(0U, [[view subviews] count]); | 101 EXPECT_EQ(0U, [[view subviews] count]); |
| 101 } | 102 } |
| 102 } // namespace | 103 } // namespace |
| OLD | NEW |