1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h"
7 #include "base/mac/scoped_nsobject.h"
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
12 class OmniboxPopupCellTest : public CocoaTest {
14 OmniboxPopupCellTest() {
17 virtual void SetUp() OVERRIDE {
19 cell_.reset([[OmniboxPopupCell alloc] initTextCell:@""]);
20 button_.reset([[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 20)]);
21 [button_ setCell:cell_];
22 [[test_window() contentView] addSubview:button_];
26 base::scoped_nsobject<OmniboxPopupCell> cell_;
27 base::scoped_nsobject<NSButton> button_;
30 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupCellTest);
33 TEST_VIEW(OmniboxPopupCellTest, button_);
35 TEST_F(OmniboxPopupCellTest, Image) {
36 [cell_ setImage:[NSImage imageNamed:NSImageNameInfo]];
40 TEST_F(OmniboxPopupCellTest, Title) {
41 base::scoped_nsobject<NSAttributedString> text([[NSAttributedString alloc]
42 initWithString:@"The quick brown fox jumps over the lazy dog."]);
43 [cell_ setAttributedTitle:text];