| 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 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 5 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 6 #include "chrome/browser/ui/cocoa/find_bar_bridge.h" | 6 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
| 7 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 7 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| 11 class FindBarBridgeTest : public CocoaTest { | 11 class FindBarBridgeTest : public CocoaTest { |
| 12 }; | 12 }; |
| 13 | 13 |
| 14 TEST_F(FindBarBridgeTest, Creation) { | 14 TEST_F(FindBarBridgeTest, Creation) { |
| 15 // Make sure the FindBarBridge constructor doesn't crash and | 15 // Make sure the FindBarBridge constructor doesn't crash and |
| 16 // properly initializes its FindBarCocoaController. | 16 // properly initializes its FindBarCocoaController. |
| 17 FindBarBridge bridge; | 17 FindBarBridge bridge; |
| 18 EXPECT_TRUE(bridge.find_bar_cocoa_controller() != NULL); | 18 EXPECT_TRUE(bridge.find_bar_cocoa_controller() != NULL); |
| 19 } | 19 } |
| 20 | 20 |
| 21 TEST_F(FindBarBridgeTest, Accessors) { | 21 TEST_F(FindBarBridgeTest, Accessors) { |
| 22 // Get/SetFindBarController are virtual methods implemented in | 22 // Get/SetFindBarController are virtual methods implemented in |
| 23 // FindBarBridge, so we test them here. | 23 // FindBarBridge, so we test them here. |
| 24 FindBarBridge* bridge = new FindBarBridge(); | 24 FindBarBridge* bridge = new FindBarBridge(); |
| 25 FindBarController controller(bridge); // takes ownership of |bridge|. | 25 FindBarController controller(bridge); // takes ownership of |bridge|. |
| 26 bridge->SetFindBarController(&controller); | 26 bridge->SetFindBarController(&controller); |
| 27 | 27 |
| 28 EXPECT_EQ(&controller, bridge->GetFindBarController()); | 28 EXPECT_EQ(&controller, bridge->GetFindBarController()); |
| 29 } | 29 } |
| 30 } // namespace | 30 } // namespace |
| OLD | NEW |