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