| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "chrome/browser/ui/cocoa/profiles/avatar_label_button.h" |
| 6 |
| 5 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 6 | 8 |
| 7 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 8 #import "chrome/browser/ui/cocoa/profiles/avatar_label_button.h" | |
| 9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 10 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 12 |
| 12 class AvatarLabelButtonTest : public CocoaTest { | 13 class AvatarLabelButtonTest : public CocoaTest { |
| 13 public: | 14 public: |
| 14 AvatarLabelButtonTest() { | 15 AvatarLabelButtonTest() { |
| 15 NSRect content_frame = [[test_window() contentView] frame]; | 16 NSRect content_frame = [[test_window() contentView] frame]; |
| 16 button_.reset([[AvatarLabelButton alloc] initWithFrame:content_frame]); | 17 button_.reset([[AvatarLabelButton alloc] initWithFrame:content_frame]); |
| 17 [[test_window() contentView] addSubview:button_]; | 18 [[test_window() contentView] addSubview:button_]; |
| 18 } | 19 } |
| 19 | 20 |
| 20 protected: | 21 protected: |
| 21 base::scoped_nsobject<AvatarLabelButton> button_; | 22 base::scoped_nsobject<AvatarLabelButton> button_; |
| 22 }; | 23 }; |
| 23 | 24 |
| 24 TEST_VIEW(AvatarLabelButtonTest, button_) | 25 TEST_VIEW(AvatarLabelButtonTest, button_) |
| 25 | 26 |
| 26 TEST_F(AvatarLabelButtonTest, TestHighlight) { | 27 TEST_F(AvatarLabelButtonTest, TestHighlight) { |
| 27 EXPECT_FALSE([[button_ cell] isHighlighted]); | 28 EXPECT_FALSE([[button_ cell] isHighlighted]); |
| 28 [button_ display]; | 29 [button_ display]; |
| 29 [[button_ cell] setHighlighted:YES]; | 30 [[button_ cell] setHighlighted:YES]; |
| 30 [button_ display]; | 31 [button_ display]; |
| 31 } | 32 } |
| OLD | NEW |