| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/ui/cocoa/autofill/down_arrow_popup_menu_cell.h" | 5 #import "chrome/browser/ui/cocoa/autofill/down_arrow_popup_menu_cell.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/macros.h" |
| 10 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" | 11 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "testing/platform_test.h" | 13 #include "testing/platform_test.h" |
| 13 #import "ui/gfx/test/ui_cocoa_test_helper.h" | 14 #import "ui/gfx/test/ui_cocoa_test_helper.h" |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 class DownArrowPopupMenuCellTest : public ui::CocoaTest { | 18 class DownArrowPopupMenuCellTest : public ui::CocoaTest { |
| 18 public: | 19 public: |
| 19 DownArrowPopupMenuCellTest() { | 20 DownArrowPopupMenuCellTest() { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 EXPECT_EQ(NSWidth(rect), [cell imageSize].width); | 59 EXPECT_EQ(NSWidth(rect), [cell imageSize].width); |
| 59 EXPECT_EQ(NSHeight(rect), [cell imageSize].height); | 60 EXPECT_EQ(NSHeight(rect), [cell imageSize].height); |
| 60 | 61 |
| 61 NSAttributedString* title = [cell attributedTitle]; | 62 NSAttributedString* title = [cell attributedTitle]; |
| 62 NSSize titleSize = [title size]; | 63 NSSize titleSize = [title size]; |
| 63 EXPECT_LE(titleSize.width + [image size].width + autofill::kButtonGap, | 64 EXPECT_LE(titleSize.width + [image size].width + autofill::kButtonGap, |
| 64 [cell cellSize].width); | 65 [cell cellSize].width); |
| 65 EXPECT_LE(std::max(titleSize.height, [image size].height), | 66 EXPECT_LE(std::max(titleSize.height, [image size].height), |
| 66 [cell cellSize].height); | 67 [cell cellSize].height); |
| 67 } | 68 } |
| OLD | NEW |