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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell_unittest.mm

Issue 1986963004: Revert of [Mac][Material Design] Update bookmarks bar to Material Design. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
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 #include "base/mac/scoped_nsobject.h" 5 #include "base/mac/scoped_nsobject.h"
6 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell.h" 6 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell.h"
7 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" 7 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
8 #include "ui/base/material_design/material_design_controller.h"
9 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/resources/grit/ui_resources.h" 9 #include "ui/resources/grit/ui_resources.h"
11 10
12 namespace { 11 namespace {
13 12
14 class BookmarkBarFolderButtonCellTest : public CocoaTest { 13 class BookmarkBarFolderButtonCellTest : public CocoaTest {
15 }; 14 };
16 15
17 // Basic creation. 16 // Basic creation.
18 TEST_F(BookmarkBarFolderButtonCellTest, Create) { 17 TEST_F(BookmarkBarFolderButtonCellTest, Create) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 50
52 [view setCell:cell.get()]; 51 [view setCell:cell.get()];
53 [folder_view setCell:folder_cell.get()]; 52 [folder_view setCell:folder_cell.get()];
54 53
55 [[test_window() contentView] addSubview:view]; 54 [[test_window() contentView] addSubview:view];
56 [[test_window() contentView] addSubview:folder_view]; 55 [[test_window() contentView] addSubview:folder_view];
57 56
58 NSRect rect = NSMakeRect(20, 20, 20, 20); 57 NSRect rect = NSMakeRect(20, 20, 20, 20);
59 58
60 [cell setBookmarkCellText:@"" image:image]; 59 [cell setBookmarkCellText:@"" image:image];
61 float icon_x_without_title = ([cell imageRectForBounds:rect]).origin.x; 60 float cell_x_without_title = ([cell imageRectForBounds:rect]).origin.x;
62 float cell_width_without_title = ([cell cellSize]).width; 61 float cell_width_without_title = ([cell cellSize]).width;
63 62
64 [cell setBookmarkCellText:@"test" image:image]; 63 [cell setBookmarkCellText:@"test" image:image];
65 float icon_x_with_title = ([cell imageRectForBounds:rect]).origin.x; 64 float cell_x_with_title = ([cell imageRectForBounds:rect]).origin.x;
66 float cell_width_with_title = ([cell cellSize]).width; 65 float cell_width_with_title = ([cell cellSize]).width;
67 66
68 EXPECT_LT(icon_x_without_title, icon_x_with_title); 67 EXPECT_LT(cell_x_without_title, cell_x_with_title);
69 EXPECT_LT(cell_width_without_title, cell_width_with_title); 68 EXPECT_LT(cell_width_without_title, cell_width_with_title);
70 69
71 [folder_cell setBookmarkCellText:@"" image:image]; 70 [folder_cell setBookmarkCellText:@"" image:image];
72 float folder_cell_x_without_title = ([cell imageRectForBounds:rect]).origin.x; 71 float folder_cell_x_without_title = ([cell imageRectForBounds:rect]).origin.x;
73 float folder_cell_width_without_title = ([cell cellSize]).width; 72 float folder_cell_width_without_title = ([cell cellSize]).width;
74 73
75 [folder_cell setBookmarkCellText:@"test" image:image]; 74 [folder_cell setBookmarkCellText:@"test" image:image];
76 float folder_cell_x_with_title = ([cell imageRectForBounds:rect]).origin.x; 75 float folder_cell_x_with_title = ([cell imageRectForBounds:rect]).origin.x;
77 float folder_cell_width_with_title = ([cell cellSize]).width; 76 float folder_cell_width_with_title = ([cell cellSize]).width;
78 77
79 EXPECT_EQ(folder_cell_x_without_title, folder_cell_x_with_title); 78 EXPECT_EQ(folder_cell_x_without_title, folder_cell_x_with_title);
80 EXPECT_EQ(folder_cell_width_without_title, folder_cell_width_with_title); 79 EXPECT_EQ(folder_cell_width_without_title, folder_cell_width_with_title);
81 } 80 }
82 81
83 } // namespace 82 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698