Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chrome/browser/cocoa/find_bar_bridge_unittest.mm

Issue 178037: Make all of our unit tests be PlatformTests to get an autorelease pool.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698