OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #include <stddef.h> | 6 #include <stddef.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 | 1015 |
1016 [bar_ loaded:model]; | 1016 [bar_ loaded:model]; |
1017 | 1017 |
1018 // Make sure the internal bookmark button also is the correct height. | 1018 // Make sure the internal bookmark button also is the correct height. |
1019 NSArray* buttons = [bar_ buttons]; | 1019 NSArray* buttons = [bar_ buttons]; |
1020 EXPECT_GT([buttons count], 0u); | 1020 EXPECT_GT([buttons count], 0u); |
1021 const bool kIsModeMaterial = ui::MaterialDesignController::IsModeMaterial(); | 1021 const bool kIsModeMaterial = ui::MaterialDesignController::IsModeMaterial(); |
1022 | 1022 |
1023 for (NSButton* button in buttons) { | 1023 for (NSButton* button in buttons) { |
1024 if (kIsModeMaterial) { | 1024 if (kIsModeMaterial) { |
1025 EXPECT_FLOAT_EQ( | 1025 EXPECT_FLOAT_EQ((chrome::kMinimumBookmarkBarHeight + |
1026 (chrome::kBookmarkBarHeight + | 1026 bookmarks::kMaterialVisualHeightOffset) - |
1027 bookmarks::kMaterialVisualHeightOffset) - | 1027 2 * bookmarks::BookmarkVerticalPadding(), |
1028 2 * bookmarks::BookmarkVerticalPadding(), | 1028 [button frame].size.height); |
1029 [button frame].size.height); | |
1030 } else { | 1029 } else { |
1031 EXPECT_FLOAT_EQ( | 1030 EXPECT_FLOAT_EQ( |
1032 (chrome::kBookmarkBarHeight + bookmarks::kVisualHeightOffset) - | 1031 (chrome::kMinimumBookmarkBarHeight + bookmarks::kVisualHeightOffset) - |
1033 2 * bookmarks::BookmarkVerticalPadding(), | 1032 2 * bookmarks::BookmarkVerticalPadding(), |
1034 [button frame].size.height); | 1033 [button frame].size.height); |
1035 } | 1034 } |
1036 } | 1035 } |
1037 } | 1036 } |
1038 | 1037 |
1039 TEST_F(BookmarkBarControllerTest, DropBookmarks) { | 1038 TEST_F(BookmarkBarControllerTest, DropBookmarks) { |
1040 const char* urls[] = { | 1039 const char* urls[] = { |
1041 "http://qwantz.com", | 1040 "http://qwantz.com", |
1042 "http://xkcd.com", | 1041 "http://xkcd.com", |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2206 "2f3b ] 4b "); | 2205 "2f3b ] 4b "); |
2207 actual = bookmarks::test::ModelStringFromNode(root); | 2206 actual = bookmarks::test::ModelStringFromNode(root); |
2208 EXPECT_EQ(expected, actual); | 2207 EXPECT_EQ(expected, actual); |
2209 | 2208 |
2210 // Verify that the other bookmark folder can't be deleted. | 2209 // Verify that the other bookmark folder can't be deleted. |
2211 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; | 2210 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; |
2212 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); | 2211 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); |
2213 } | 2212 } |
2214 | 2213 |
2215 } // namespace | 2214 } // namespace |
OLD | NEW |