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

Unified Diff: chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc

Issue 1469423002: Modify toolbar action bar layout for material design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more comments addressed Created 5 years 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
Index: chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc
index b0ce77b1658d5ce3e7ccf27e9df1ac2c5d6ac851..350baa330d579f8664d58a9c1af73152b0bce0fc 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc
@@ -204,18 +204,18 @@ TEST_F(ToolbarActionsBarUnitTest, BasicToolbarActionsBarTest) {
// By default, all three actions should be visible.
EXPECT_EQ(3u, toolbar_actions_bar()->GetIconCount());
- // Check the widths.
- int expected_width = 3 * ToolbarActionsBar::IconWidth(true) -
- platform_settings.item_spacing +
- platform_settings.left_padding +
- platform_settings.right_padding;
+ // Check the widths. IconWidth(true) includes the spacing to the left of
+ // each icon and |item_spacing| accounts for the spacing to the right
+ // of the rightmost icon.
+ int expected_width =
+ 3 * ToolbarActionsBar::IconWidth(true) + platform_settings.item_spacing;
EXPECT_EQ(expected_width, toolbar_actions_bar()->GetPreferredSize().width());
// Since all icons are showing, the current width should be the max width.
int maximum_width = expected_width;
EXPECT_EQ(maximum_width, toolbar_actions_bar()->GetMaximumWidth());
- // The minimum width should be just enough for the chevron to be displayed.
- int minimum_width = platform_settings.left_padding +
- platform_settings.right_padding +
+ // The minimum width should be just enough for the chevron to be displayed
+ // along with left and right padding.
+ int minimum_width = 2 * platform_settings.item_spacing +
toolbar_actions_bar()->delegate_for_test()->
GetChevronWidth();
EXPECT_EQ(minimum_width, toolbar_actions_bar()->GetMinimumWidth());
@@ -226,10 +226,11 @@ TEST_F(ToolbarActionsBarUnitTest, BasicToolbarActionsBarTest) {
EXPECT_EQ(2u, toolbar_actions_bar()->GetIconCount());
// The current width should now be enough for two icons, and the chevron.
- expected_width = 2 * ToolbarActionsBar::IconWidth(true) -
+ // IconWidth(true) includes the spacing to the left of each icon and
+ // |item_spacing| accounts for the spacing to the right of the rightmost
+ // icon.
+ expected_width = 2 * ToolbarActionsBar::IconWidth(true) +
platform_settings.item_spacing +
- platform_settings.left_padding +
- platform_settings.right_padding +
toolbar_actions_bar()->delegate_for_test()->
GetChevronWidth();
EXPECT_EQ(expected_width, toolbar_actions_bar()->GetPreferredSize().width());
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_actions_bar.cc ('k') | chrome/browser/ui/views/toolbar/browser_actions_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698