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

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

Issue 2828005: Unify the page and wrench menus into one wrench menu. Remove pref to hide men... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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/toolbar_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/cocoa/toolbar_controller_unittest.mm
===================================================================
--- chrome/browser/cocoa/toolbar_controller_unittest.mm (revision 49817)
+++ chrome/browser/cocoa/toolbar_controller_unittest.mm (working copy)
@@ -43,7 +43,7 @@
// Indexes that match the ordering returned by the private ToolbarController
// |-toolbarViews| method.
enum {
- kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex, kPageIndex,
+ kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex,
kWrenchIndex, kLocationIndex, kBrowserActionContainerViewIndex
};
@@ -182,45 +182,19 @@
EXPECT_NE(NSWidth(originalLocationBarFrame), NSWidth([locationBar frame]));
}
-TEST_F(ToolbarControllerTest, TogglePageWrench) {
- PrefService* prefs = helper_.profile()->GetPrefs();
- bool showButtons = prefs->GetBoolean(prefs::kShowPageOptionsButtons);
- NSView* pageButton = [[bar_ toolbarViews] objectAtIndex:kPageIndex];
- NSView* wrenchButton = [[bar_ toolbarViews] objectAtIndex:kWrenchIndex];
- EXPECT_EQ(showButtons, ![pageButton isHidden]);
- EXPECT_EQ(showButtons, ![wrenchButton isHidden]);
-
- NSView* locationBar = [[bar_ toolbarViews] objectAtIndex:kLocationIndex];
- NSRect originalLocationBarFrame = [locationBar frame];
-
- // Toggle the pref and make sure the buttons changed state and the other
- // views moved (or in the case of the location bar, it changed width).
- prefs->SetBoolean(prefs::kShowPageOptionsButtons, !showButtons);
- EXPECT_EQ(showButtons, [pageButton isHidden]);
- EXPECT_EQ(showButtons, [wrenchButton isHidden]);
- EXPECT_NE(NSWidth(originalLocationBarFrame), NSWidth([locationBar frame]));
-}
-
// Ensure that we don't toggle the buttons when we have a strip marked as not
// having the full toolbar. Also ensure that the location bar doesn't change
// size.
TEST_F(ToolbarControllerTest, DontToggleWhenNoToolbar) {
[bar_ setHasToolbar:NO hasLocationBar:YES];
NSView* homeButton = [[bar_ toolbarViews] objectAtIndex:kHomeIndex];
- NSView* pageButton = [[bar_ toolbarViews] objectAtIndex:kPageIndex];
- NSView* wrenchButton = [[bar_ toolbarViews] objectAtIndex:kWrenchIndex];
NSView* locationBar = [[bar_ toolbarViews] objectAtIndex:kLocationIndex];
NSRect locationBarFrame = [locationBar frame];
EXPECT_EQ([homeButton isHidden], YES);
- EXPECT_EQ([pageButton isHidden], YES);
- EXPECT_EQ([wrenchButton isHidden], YES);
[bar_ showOptionalHomeButton];
EXPECT_EQ([homeButton isHidden], YES);
NSRect newLocationBarFrame = [locationBar frame];
EXPECT_TRUE(NSEqualRects(locationBarFrame, newLocationBarFrame));
- [bar_ showOptionalPageWrenchButtons];
- EXPECT_EQ([pageButton isHidden], YES);
- EXPECT_EQ([wrenchButton isHidden], YES);
newLocationBarFrame = [locationBar frame];
EXPECT_TRUE(NSEqualRects(locationBarFrame, newLocationBarFrame));
}
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698