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

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

Issue 3198005: Disable the stop button when the user is hovering it and the page finishes lo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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/reload_button.mm ('k') | chrome/browser/gtk/reload_button_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/reload_button_unittest.mm
===================================================================
--- chrome/browser/cocoa/reload_button_unittest.mm (revision 56775)
+++ chrome/browser/cocoa/reload_button_unittest.mm (working copy)
@@ -154,6 +154,7 @@
// Get to stop mode.
[button_ setIsLoading:YES force:YES];
EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_TRUE([button_ isEnabled]);
// Expect the action once.
[[mock_target expect] anAction:button_];
@@ -165,21 +166,23 @@
[NSApp postEvent:click.second atStart:YES];
[button_ mouseDown:click.first];
EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_TRUE([button_ isEnabled]);
// Get back to stop mode.
[button_ setIsLoading:YES force:YES];
EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_TRUE([button_ isEnabled]);
- // If hover prevented reload mode immediately taking effect, clicks
- // should not send any action, but should still transition to reload
- // mode.
+ // If hover prevented reload mode immediately taking effect, clicks should do
+ // nothing, because the button should be disabled.
[button_ mouseEntered:nil];
EXPECT_TRUE([button_ isMouseInside]);
[button_ setIsLoading:NO force:NO];
EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_FALSE([button_ isEnabled]);
[NSApp postEvent:click.second atStart:YES];
[button_ mouseDown:click.first];
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ tag], IDC_STOP);
[button_ setTarget:nil];
}
« no previous file with comments | « chrome/browser/cocoa/reload_button.mm ('k') | chrome/browser/gtk/reload_button_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698