OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/chrome/browser/ui/settings/cells/account_signin_item.h" |
| 6 |
| 7 #import <CoreGraphics/CoreGraphics.h> |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "testing/gtest_mac.h" |
| 12 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." |
| 15 #endif |
| 16 |
| 17 // Tests that the UIImage and UILabels are set properly after a call to |
| 18 // |configureCell:|. |
| 19 |
| 20 TEST(AccountSignInItemTest, ImageView) { |
| 21 AccountSignInItem* item = [[AccountSignInItem alloc] initWithType:0]; |
| 22 UIImage* image = [[UIImage alloc] init]; |
| 23 |
| 24 item.image = image; |
| 25 |
| 26 id cell = [[[item cellClass] alloc] init]; |
| 27 ASSERT_TRUE([cell isMemberOfClass:[AccountSignInCell class]]); |
| 28 |
| 29 AccountSignInCell* signInCell = cell; |
| 30 EXPECT_FALSE(signInCell.imageView.image); |
| 31 |
| 32 [item configureCell:cell]; |
| 33 EXPECT_NSEQ(image, signInCell.imageView.image); |
| 34 } |
OLD | NEW |