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) { |