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

Unified Diff: chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm

Issue 8344048: [Mac] Show the edit profile link after a dwell delay so that it doesn't flicker when scrubbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 2 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/ui/cocoa/browser/avatar_menu_bubble_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm
index 909e0024a33776119a917eb935129263d3093be3..cd8ffd95c5043855b2c73668cd8e7f290b5e6c40 100644
--- a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm
@@ -167,13 +167,21 @@ TEST_F(AvatarMenuBubbleControllerTest, PerformLayout) {
}
- (void)animationDidEnd:(NSAnimation*)anim {
+ [super animationDidEnd:anim];
pump_->Quit();
}
- (void)animationDidStop:(NSAnimation*)anim {
+ [super animationDidStop:anim];
FAIL() << "Animation stopped before it completed its run";
pump_->Quit();
}
+
+- (void)sendHighlightMessageForMouseExited {
+ [self highlightForEventType:NSMouseExited];
+ // Quit the pump because the animation was cancelled before it even ran.
+ pump_->Quit();
+}
@end
TEST_F(AvatarMenuBubbleControllerTest, HighlightForEventType) {
@@ -209,6 +217,17 @@ TEST_F(AvatarMenuBubbleControllerTest, HighlightForEventType) {
EXPECT_TRUE(editButton.isHidden);
EXPECT_FALSE(emailField.isHidden);
+
+ // Now mouse over and out quickly, as if scrubbing through the menu, to test
+ // the hover dwell delay.
+ [item highlightForEventType:NSMouseEntered];
+ [item performSelector:@selector(sendHighlightMessageForMouseExited)
+ withObject:nil
+ afterDelay:0];
+ [item runMessagePump];
+
+ EXPECT_TRUE(editButton.isHidden);
+ EXPECT_FALSE(emailField.isHidden);
}
TEST_F(AvatarMenuBubbleControllerTest, DownArrow) {
« no previous file with comments | « chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698