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

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

Issue 2973004: [Mac]Implement ViewID support. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Turns out that, it's not a good solution. 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/reload_button.mm ('k') | chrome/browser/cocoa/side_tab_strip_view.mm » ('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
diff --git a/chrome/browser/cocoa/reload_button_unittest.mm b/chrome/browser/cocoa/reload_button_unittest.mm
index 64deb9694072b296e51ab86dfbe16d5b2356c99d..312be680bc5fc08b7af7d451e0ce1310e7128e08 100644
--- a/chrome/browser/cocoa/reload_button_unittest.mm
+++ b/chrome/browser/cocoa/reload_button_unittest.mm
@@ -29,7 +29,7 @@ class ReloadButtonTest : public CocoaTest {
button_ = button.get();
// Set things up so unit tests have a reliable baseline.
- [button_ setTag:IDC_RELOAD];
+ [button_ setCommand:IDC_RELOAD];
[button_ awakeFromNib];
[[test_window() contentView] addSubview:button_];
@@ -76,70 +76,70 @@ TEST_F(ReloadButtonTest, IgnoredMultiClick) {
// regardless of whether the mouse is hovering.
TEST_F(ReloadButtonTest, SetIsLoadingForce) {
EXPECT_FALSE([button_ isMouseInside]);
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ command], IDC_RELOAD);
// Changes to stop immediately.
[button_ setIsLoading:YES force:YES];
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
// Changes to reload immediately.
[button_ setIsLoading:NO force:YES];
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ command], IDC_RELOAD);
// Changes to stop immediately when the mouse is hovered, and
// doesn't change when the mouse exits.
[button_ mouseEntered:nil];
EXPECT_TRUE([button_ isMouseInside]);
[button_ setIsLoading:YES force:YES];
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
[button_ mouseExited:nil];
EXPECT_FALSE([button_ isMouseInside]);
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
// Changes to reload immediately when the mouse is hovered, and
// doesn't change when the mouse exits.
[button_ mouseEntered:nil];
EXPECT_TRUE([button_ isMouseInside]);
[button_ setIsLoading:NO force:YES];
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ command], IDC_RELOAD);
[button_ mouseExited:nil];
EXPECT_FALSE([button_ isMouseInside]);
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ command], IDC_RELOAD);
}
// Test that without force, stop mode is set immediately, but reload
// is affected by the hover status.
TEST_F(ReloadButtonTest, SetIsLoadingNoForce) {
EXPECT_FALSE([button_ isMouseInside]);
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ command], IDC_RELOAD);
// Changes to stop immediately when the mouse is not hovering.
[button_ setIsLoading:YES force:NO];
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
// Changes to reload immediately when the mouse is not hovering.
[button_ setIsLoading:NO force:NO];
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ command], IDC_RELOAD);
// Changes to stop immediately when the mouse is hovered, and
// doesn't change when the mouse exits.
[button_ mouseEntered:nil];
EXPECT_TRUE([button_ isMouseInside]);
[button_ setIsLoading:YES force:NO];
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
[button_ mouseExited:nil];
EXPECT_FALSE([button_ isMouseInside]);
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
// Does not change to reload immediately when the mouse is hovered,
// changes when the mouse exits.
[button_ mouseEntered:nil];
EXPECT_TRUE([button_ isMouseInside]);
[button_ setIsLoading:NO force:NO];
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
[button_ mouseExited:nil];
EXPECT_FALSE([button_ isMouseInside]);
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ command], IDC_RELOAD);
}
// Test that pressing stop after reload mode has been requested
@@ -153,7 +153,7 @@ TEST_F(ReloadButtonTest, StopAfterReloadSet) {
// Get to stop mode.
[button_ setIsLoading:YES force:YES];
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
// Expect the action once.
[[mock_target expect] anAction:button_];
@@ -164,11 +164,11 @@ TEST_F(ReloadButtonTest, StopAfterReloadSet) {
test_event_utils::MouseClickInView(button_, 1);
[NSApp postEvent:click.second atStart:YES];
[button_ mouseDown:click.first];
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ command], IDC_RELOAD);
// Get back to stop mode.
[button_ setIsLoading:YES force:YES];
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
// If hover prevented reload mode immediately taking effect, clicks
// should not send any action, but should still transition to reload
@@ -176,10 +176,10 @@ TEST_F(ReloadButtonTest, StopAfterReloadSet) {
[button_ mouseEntered:nil];
EXPECT_TRUE([button_ isMouseInside]);
[button_ setIsLoading:NO force:NO];
- EXPECT_EQ([button_ tag], IDC_STOP);
+ EXPECT_EQ([button_ command], IDC_STOP);
[NSApp postEvent:click.second atStart:YES];
[button_ mouseDown:click.first];
- EXPECT_EQ([button_ tag], IDC_RELOAD);
+ EXPECT_EQ([button_ command], IDC_RELOAD);
[button_ setTarget:nil];
}
« no previous file with comments | « chrome/browser/cocoa/reload_button.mm ('k') | chrome/browser/cocoa/side_tab_strip_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698