| Index: chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell_unittest.mm
|
| diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell_unittest.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell_unittest.mm
|
| index e4bb64b0d6493831e6bd7e8d7a63fbd022aa9600..a9889f4042ddea4b4f74c19fb8bc780fa7ce8a7b 100644
|
| --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell_unittest.mm
|
| +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell_unittest.mm
|
| @@ -7,6 +7,12 @@
|
| #include "base/mac/scoped_nsobject.h"
|
| #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
|
|
|
| +@interface OmniboxPopupCellData ()
|
| +- (void)setContents:(NSAttributedString*)contents;
|
| +
|
| +- (void)setImage:(NSImage*)image;
|
| +@end
|
| +
|
| namespace {
|
|
|
| class OmniboxPopupCellTest : public CocoaTest {
|
| @@ -16,32 +22,35 @@ class OmniboxPopupCellTest : public CocoaTest {
|
|
|
| void SetUp() override {
|
| CocoaTest::SetUp();
|
| - cell_.reset([[OmniboxPopupCell alloc] initTextCell:@""]);
|
| - button_.reset([[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 20)]);
|
| - [button_ setCell:cell_];
|
| - [[test_window() contentView] addSubview:button_];
|
| + cellData_.reset([[OmniboxPopupCellData alloc] init]);
|
| + cell_.reset([[OmniboxPopupCell alloc] init]);
|
| + [cell_ setCellData:cellData_];
|
| + control_.reset([[NSControl alloc] initWithFrame:NSMakeRect(0, 0, 200, 20)]);
|
| + [control_ setCell:cell_];
|
| + [[test_window() contentView] addSubview:control_];
|
| };
|
|
|
| protected:
|
| + base::scoped_nsobject<OmniboxPopupCellData> cellData_;
|
| base::scoped_nsobject<OmniboxPopupCell> cell_;
|
| - base::scoped_nsobject<NSButton> button_;
|
| + base::scoped_nsobject<NSControl> control_;
|
|
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(OmniboxPopupCellTest);
|
| };
|
|
|
| -TEST_VIEW(OmniboxPopupCellTest, button_);
|
| +TEST_VIEW(OmniboxPopupCellTest, control_);
|
|
|
| TEST_F(OmniboxPopupCellTest, Image) {
|
| - [cell_ setImage:[NSImage imageNamed:NSImageNameInfo]];
|
| - [button_ display];
|
| + [cellData_ setImage:[NSImage imageNamed:NSImageNameInfo]];
|
| + [control_ display];
|
| }
|
|
|
| TEST_F(OmniboxPopupCellTest, Title) {
|
| base::scoped_nsobject<NSAttributedString> text([[NSAttributedString alloc]
|
| initWithString:@"The quick brown fox jumps over the lazy dog."]);
|
| - [cell_ setAttributedTitle:text];
|
| - [button_ display];
|
| + [cellData_ setContents:text];
|
| + [control_ display];
|
| }
|
|
|
| } // namespace
|
|
|