Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package

find_bar_bridge_unittest.mm

// Copyright (c) 2009 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.

#include "chrome/browser/find_bar_controller.h"
#include "chrome/browser/cocoa/cocoa_test_helper.h"
#include "chrome/browser/cocoa/find_bar_bridge.h"

namespace {

class FindBarBridgeTest : public CocoaTest {
};

TEST_F(FindBarBridgeTest, Creation) {
  // Make sure the FindBarBridge constructor doesn't crash and
  // properly initializes its FindBarCocoaController.
  FindBarBridge bridge;
  EXPECT_TRUE(bridge.find_bar_cocoa_controller() != NULL);
}

TEST_F(FindBarBridgeTest, Accessors) {
  // Get/SetFindBarController are virtual methods implemented in
  // FindBarBridge, so we test them here.
  FindBarBridge* bridge = new FindBarBridge();
  FindBarController controller(bridge);  // takes ownership of |bridge|.
  bridge->SetFindBarController(&controller);

  EXPECT_EQ(&controller, bridge->GetFindBarController());
}
}  // namespace

Generated by  Doxygen 1.6.0   Back to index