| Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
|
| diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
|
| index cc6e46ae0c6fc59d347aa138f0ba4e55698ba638..d5d508fd1ddf4e59e357c17a6b3acd9c82d9b7ba 100644
|
| --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
|
| +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
|
| @@ -39,6 +39,7 @@
|
| #import "third_party/ocmock/OCMock/OCMock.h"
|
| #include "third_party/ocmock/gtest_support.h"
|
| #include "ui/base/cocoa/animation_utils.h"
|
| +#include "ui/base/material_design/material_design_controller.h"
|
| #include "ui/base/theme_provider.h"
|
| #include "ui/events/test/cocoa_test_event_utils.h"
|
| #include "ui/gfx/image/image_skia.h"
|
| @@ -1014,11 +1015,20 @@ TEST_F(BookmarkBarControllerTest, BookmarkButtonSizing) {
|
| // Make sure the internal bookmark button also is the correct height.
|
| NSArray* buttons = [bar_ buttons];
|
| EXPECT_GT([buttons count], 0u);
|
| + const bool kIsModeMaterial = ui::MaterialDesignController::IsModeMaterial();
|
| +
|
| for (NSButton* button in buttons) {
|
| - EXPECT_FLOAT_EQ(
|
| - (chrome::kBookmarkBarHeight + bookmarks::kVisualHeightOffset) -
|
| - 2 * bookmarks::kBookmarkVerticalPadding,
|
| - [button frame].size.height);
|
| + if (kIsModeMaterial) {
|
| + EXPECT_FLOAT_EQ(
|
| + (chrome::kBookmarkBarHeight + bookmarks::VisualHeightOffset()) -
|
| + 2 * bookmarks::kMaterialBookmarkVerticalPadding,
|
| + [button frame].size.height);
|
| + } else {
|
| + EXPECT_FLOAT_EQ(
|
| + (chrome::kBookmarkBarHeight + bookmarks::VisualHeightOffset()) -
|
| + 2 * bookmarks::kBookmarkVerticalPadding,
|
| + [button frame].size.height);
|
| + }
|
| }
|
| }
|
|
|
| @@ -1594,7 +1604,7 @@ TEST_F(BookmarkBarControllerTest, LastBookmarkResizeBehavior) {
|
| 2, 1 };
|
| for (unsigned int i = 0; i < arraysize(viewWidthsYosemite); ++i) {
|
| NSRect frame = [[bar_ view] frame];
|
| - frame.size.width = viewWidths[i] + bookmarks::kBookmarkRightMargin;
|
| + frame.size.width = viewWidths[i] + bookmarks::BookmarkRightMargin();
|
| [[bar_ view] setFrame:frame];
|
| EXPECT_EQ(offTheSideButtonIsHiddenResults[i],
|
| [bar_ offTheSideButtonIsHidden]);
|
| @@ -2050,8 +2060,8 @@ TEST_F(BookmarkBarControllerDragDropTest, DropPositionIndicator) {
|
| BookmarkButton* targetButton = [bar_ buttonWithTitleEqualTo:@"1b"];
|
| ASSERT_TRUE(targetButton);
|
| NSPoint targetPoint = [targetButton left];
|
| - CGFloat leftMarginIndicatorPosition = bookmarks::kBookmarkLeftMargin - 0.5 *
|
| - bookmarks::kBookmarkHorizontalPadding;
|
| + CGFloat leftMarginIndicatorPosition = bookmarks::BookmarkLeftMargin() - 0.5 *
|
| + bookmarks::BookmarkHorizontalPadding();
|
| const CGFloat baseOffset = targetPoint.x;
|
| CGFloat expected = leftMarginIndicatorPosition;
|
| CGFloat actual = [bar_ indicatorPosForDragToPoint:targetPoint];
|
| @@ -2064,7 +2074,7 @@ TEST_F(BookmarkBarControllerDragDropTest, DropPositionIndicator) {
|
| targetButton = [bar_ buttonWithTitleEqualTo:@"4b"];
|
| targetPoint = [targetButton right];
|
| targetPoint.x += 100; // Somewhere off to the right.
|
| - CGFloat xDelta = 0.5 * bookmarks::kBookmarkHorizontalPadding;
|
| + CGFloat xDelta = 0.5 * bookmarks::BookmarkHorizontalPadding();
|
| expected = NSMaxX([targetButton frame]) + xDelta;
|
| actual = [bar_ indicatorPosForDragToPoint:targetPoint];
|
| EXPECT_CGFLOAT_EQ(expected, actual);
|
|
|