Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Unified Diff: chrome/browser/cocoa/gradient_button_cell_unittest.mm

Issue 165499: Updates to clean up default theme and add hover states (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/gradient_button_cell.mm ('k') | chrome/browser/cocoa/status_bubble_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/gradient_button_cell_unittest.mm
===================================================================
--- chrome/browser/cocoa/gradient_button_cell_unittest.mm (revision 24798)
+++ chrome/browser/cocoa/gradient_button_cell_unittest.mm (working copy)
@@ -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,9 +40,27 @@
// 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
TEST_F(GradientButtonCellTest, TrackingRects) {
GradientButtonCell* cell = [view_ cell];
« no previous file with comments | « chrome/browser/cocoa/gradient_button_cell.mm ('k') | chrome/browser/cocoa/status_bubble_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698