summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/gradient_button_cell_unittest.mm
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 20:20:51 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 20:20:51 +0000
commit71f4c1dc80499f254b9f06e510002ff3b43a87e0 (patch)
tree6eeb8693a47e7990e5bb3995812e2fa641bcda09 /chrome/browser/cocoa/gradient_button_cell_unittest.mm
parent7cc6c0ba59df63f9f084f8cdfc695fa7b4ae1823 (diff)
downloadchromium_src-71f4c1dc80499f254b9f06e510002ff3b43a87e0.zip
chromium_src-71f4c1dc80499f254b9f06e510002ff3b43a87e0.tar.gz
chromium_src-71f4c1dc80499f254b9f06e510002ff3b43a87e0.tar.bz2
Updates to clean up default theme and add hover states.
Path by Cole. BUG=http://crbug.com/18573;http://crbug.com/18574;http://crbug.com/18360;http://crbug.com/18438 TEST=none Review URL: http://codereview.chromium.org/165499 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24512 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/gradient_button_cell_unittest.mm')
-rw-r--r--chrome/browser/cocoa/gradient_button_cell_unittest.mm22
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/gradient_button_cell_unittest.mm b/chrome/browser/cocoa/gradient_button_cell_unittest.mm
index 3e0f162..e9229a7 100644
--- a/chrome/browser/cocoa/gradient_button_cell_unittest.mm
+++ b/chrome/browser/cocoa/gradient_button_cell_unittest.mm
@@ -9,6 +9,10 @@
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+@interface GradientButtonCell (HoverValueTesting)
+- (void)adjustHoverValue;
+@end
+
namespace {
class GradientButtonCellTest : public testing::Test {
@@ -36,7 +40,25 @@ TEST_F(GradientButtonCellTest, AddRemove) {
// Test drawing, mostly to ensure nothing leaks or crashes.
TEST_F(GradientButtonCellTest, Display) {
+ [[view_ cell] setHoverAlpha:0.0];
+ [view_ display];
+ [[view_ cell] setHoverAlpha:0.5];
[view_ display];
+ [[view_ cell] setHoverAlpha:1.0];
+ [view_ display];
+}
+
+// Test drawing, mostly to ensure nothing leaks or crashes.
+TEST_F(GradientButtonCellTest, Hover) {
+ GradientButtonCell* cell = [view_ cell];
+ [cell setMouseInside:YES animate:NO];
+ EXPECT_EQ([[view_ cell] hoverAlpha], 1.0);
+
+ [cell setMouseInside:NO animate:YES];
+ CGFloat alpha1 = [cell hoverAlpha];
+ [cell adjustHoverValue];
+ CGFloat alpha2 = [cell hoverAlpha];
+ EXPECT_TRUE(alpha2 < alpha1);
}
// Tracking rects