OLD | NEW |
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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/scoped_nsobject.h" | 7 #include "base/scoped_nsobject.h" |
8 #import "chrome/browser/cocoa/gradient_button_cell.h" | 8 #import "chrome/browser/cocoa/gradient_button_cell.h" |
9 #import "chrome/browser/cocoa/cocoa_test_helper.h" | 9 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "testing/platform_test.h" |
11 | 12 |
12 @interface GradientButtonCell (HoverValueTesting) | 13 @interface GradientButtonCell (HoverValueTesting) |
13 - (void)adjustHoverValue; | 14 - (void)adjustHoverValue; |
14 @end | 15 @end |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
18 class GradientButtonCellTest : public testing::Test { | 19 class GradientButtonCellTest : public PlatformTest { |
19 public: | 20 public: |
20 GradientButtonCellTest() { | 21 GradientButtonCellTest() { |
21 NSRect frame = NSMakeRect(0, 0, 50, 30); | 22 NSRect frame = NSMakeRect(0, 0, 50, 30); |
22 view_.reset([[NSButton alloc] initWithFrame:frame]); | 23 view_.reset([[NSButton alloc] initWithFrame:frame]); |
23 scoped_nsobject<GradientButtonCell> cell([[GradientButtonCell alloc] | 24 scoped_nsobject<GradientButtonCell> cell([[GradientButtonCell alloc] |
24 initTextCell:@"Testing"]); | 25 initTextCell:@"Testing"]); |
25 [view_ setCell:cell.get()]; | 26 [view_ setCell:cell.get()]; |
26 [cocoa_helper_.contentView() addSubview:view_.get()]; | 27 [cocoa_helper_.contentView() addSubview:view_.get()]; |
27 } | 28 } |
28 | 29 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 [cell setShowsBorderOnlyWhileMouseInside:NO]; | 77 [cell setShowsBorderOnlyWhileMouseInside:NO]; |
77 EXPECT_FALSE([cell isMouseInside]); | 78 EXPECT_FALSE([cell isMouseInside]); |
78 | 79 |
79 [cell setShowsBorderOnlyWhileMouseInside:YES]; | 80 [cell setShowsBorderOnlyWhileMouseInside:YES]; |
80 [cell setShowsBorderOnlyWhileMouseInside:YES]; | 81 [cell setShowsBorderOnlyWhileMouseInside:YES]; |
81 [cell setShowsBorderOnlyWhileMouseInside:NO]; | 82 [cell setShowsBorderOnlyWhileMouseInside:NO]; |
82 [cell setShowsBorderOnlyWhileMouseInside:NO]; | 83 [cell setShowsBorderOnlyWhileMouseInside:NO]; |
83 } | 84 } |
84 | 85 |
85 } // namespace | 86 } // namespace |
OLD | NEW |