| 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 #include "base/memory/scoped_nsobject.h" | 5 #include "base/memory/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 "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/mac/nsimage_cache.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) { |
| 19 scoped_nsobject<BookmarkBarFolderButtonCell> cell; | 18 scoped_nsobject<BookmarkBarFolderButtonCell> cell; |
| 20 cell.reset([[BookmarkBarFolderButtonCell buttonCellForNode:nil | 19 cell.reset([[BookmarkBarFolderButtonCell buttonCellForNode:nil |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |