| 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 "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" | 10 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 base::scoped_nsobject<NSImage> image( | 53 base::scoped_nsobject<NSImage> image( |
| 54 [[NSImage alloc] initWithSize:rect.size]); | 54 [[NSImage alloc] initWithSize:rect.size]); |
| 55 [cell setImage:image forButtonState:image_button_cell::kDefaultState]; | 55 [cell setImage:image forButtonState:image_button_cell::kDefaultState]; |
| 56 [view_ setTitle:@"Testing"]; | 56 [view_ setTitle:@"Testing"]; |
| 57 | 57 |
| 58 EXPECT_EQ(NSWidth(rect), [cell imageSize].width); | 58 EXPECT_EQ(NSWidth(rect), [cell imageSize].width); |
| 59 EXPECT_EQ(NSHeight(rect), [cell imageSize].height); | 59 EXPECT_EQ(NSHeight(rect), [cell imageSize].height); |
| 60 | 60 |
| 61 NSAttributedString* title = [cell attributedTitle]; | 61 NSAttributedString* title = [cell attributedTitle]; |
| 62 NSSize titleSize = [title size]; | 62 NSSize titleSize = [title size]; |
| 63 EXPECT_EQ(titleSize.width + [image size].width + kButtonGap, | 63 EXPECT_EQ(titleSize.width + [image size].width + autofill::kButtonGap, |
| 64 [cell cellSize].width); | 64 [cell cellSize].width); |
| 65 EXPECT_EQ(std::max(titleSize.height, [image size].height), | 65 EXPECT_EQ(std::max(titleSize.height, [image size].height), |
| 66 [cell cellSize].height); | 66 [cell cellSize].height); |
| 67 } | 67 } |
| OLD | NEW |