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

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

Issue 2805099: Pulse new bookmarks (as triggered by bookmark bubble). If not possible, ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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') | no next file » | 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 53704)
+++ chrome/browser/cocoa/gradient_button_cell_unittest.mm (working copy)
@@ -11,7 +11,7 @@
#include "testing/platform_test.h"
@interface GradientButtonCell (HoverValueTesting)
-- (void)adjustHoverValue;
+- (void)performOnePulseStep;
@end
namespace {
@@ -51,7 +51,7 @@
[cell setMouseInside:NO animate:YES];
CGFloat alpha1 = [cell hoverAlpha];
- [cell adjustHoverValue];
+ [cell performOnePulseStep];
CGFloat alpha2 = [cell hoverAlpha];
EXPECT_TRUE(alpha2 < alpha1);
}
@@ -77,4 +77,36 @@
[cell setShowsBorderOnlyWhileMouseInside:NO];
}
+TEST_F(GradientButtonCellTest, ContinuousPulseOnOff) {
+ GradientButtonCell* cell = [view_ cell];
+
+ // On/off
+ EXPECT_FALSE([cell isContinuousPulsing]);
+ [cell setIsContinuousPulsing:YES];
+ EXPECT_TRUE([cell isContinuousPulsing]);
+ EXPECT_TRUE([cell pulsing]);
+ [cell setIsContinuousPulsing:NO];
+ EXPECT_FALSE([cell isContinuousPulsing]);
+
+ // On/safeOff
+ [cell setIsContinuousPulsing:YES];
+ EXPECT_TRUE([cell isContinuousPulsing]);
+ [cell safelyStopPulsing];
+}
+
+// More for valgrind; we don't confirm state change does anything useful.
+TEST_F(GradientButtonCellTest, PulseState) {
+ GradientButtonCell* cell = [view_ cell];
+
+ [cell setMouseInside:YES animate:YES];
+ // Allow for immediate state changes to keep test unflaky
+ EXPECT_TRUE(([cell pulseState] == gradient_button_cell::kPulsingOn) ||
+ ([cell pulseState] == gradient_button_cell::kPulsedOn));
+
+ [cell setMouseInside:NO animate:YES];
+ // Allow for immediate state changes to keep test unflaky
+ EXPECT_TRUE(([cell pulseState] == gradient_button_cell::kPulsingOff) ||
+ ([cell pulseState] == gradient_button_cell::kPulsedOff));
+}
+
} // namespace
« no previous file with comments | « chrome/browser/cocoa/gradient_button_cell.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698