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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm

Issue 659693002: mac: Fix a bookmark bar unit test on OSX 10.10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from rsesek. Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 688c7ba4a2a1c51417ae06340fdcc8538ea3ea07..7b64a056294518e0e3c21719f714126d080cd887 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
@@ -6,6 +6,7 @@
#include "base/basictypes.h"
#include "base/command_line.h"
+#include "base/mac/mac_util.h"
#include "base/mac/scoped_nsobject.h"
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
@@ -1576,16 +1577,22 @@ TEST_F(BookmarkBarControllerTest, LastBookmarkResizeBehavior) {
test::AddNodesFromModelString(model, root, model_string);
[bar_ frameDidChange];
- CGFloat viewWidths[] = { 123.0, 124.0, 151.0, 152.0, 153.0, 154.0, 155.0,
- 200.0, 155.0, 154.0, 153.0, 152.0, 151.0, 124.0,
- 123.0 };
+ // The default font changed between OSX Mavericks and OSX Yosemite, so this
+ // test requires different widths to trigger the appropriate results.
+ CGFloat viewWidthsYosemite[] = { 121.0, 122.0, 148.0, 149.0, 150.0, 151.0,
+ 152.0, 200.0, 152.0, 151.0, 150.0, 149.0,
+ 148.0, 122.0, 121.0 };
+ CGFloat viewWidthsMavericks[] = { 123.0, 124.0, 151.0, 152.0, 153.0, 154.0,
+ 155.0, 200.0, 155.0, 154.0, 153.0, 152.0,
+ 151.0, 124.0, 123.0 };
BOOL offTheSideButtonIsHiddenResults[] = { NO, NO, NO, NO, YES, YES, YES, YES,
YES, YES, YES, NO, NO, NO, NO};
int displayedButtonCountResults[] = { 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2, 1 };
+ CGFloat* viewWidths = base::mac::IsOSYosemiteOrLater() ? viewWidthsYosemite
+ : viewWidthsMavericks;
- for (unsigned int i = 0; i < sizeof(viewWidths) / sizeof(viewWidths[0]);
- ++i) {
+ for (unsigned int i = 0; i < arraysize(viewWidthsYosemite); ++i) {
NSRect frame = [[bar_ view] frame];
frame.size.width = viewWidths[i] + bookmarks::kBookmarkRightMargin;
[[bar_ view] setFrame:frame];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698