Index: ios/chrome/browser/ui/settings/cells/account_signin_item_unittest.mm |
diff --git a/ios/chrome/browser/ui/settings/cells/account_signin_item_unittest.mm b/ios/chrome/browser/ui/settings/cells/account_signin_item_unittest.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..30e4718fde7d17871be1e48eaa5e9910db6aadab |
--- /dev/null |
+++ b/ios/chrome/browser/ui/settings/cells/account_signin_item_unittest.mm |
@@ -0,0 +1,34 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import "ios/chrome/browser/ui/settings/cells/account_signin_item.h" |
+ |
+#import <CoreGraphics/CoreGraphics.h> |
+#import <UIKit/UIKit.h> |
+ |
+#include "testing/gtest/include/gtest/gtest.h" |
+#include "testing/gtest_mac.h" |
+ |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
+// Tests that the UIImage and UILabels are set properly after a call to |
+// |configureCell:|. |
+ |
+TEST(AccountSignInItemTest, ImageView) { |
+ AccountSignInItem* item = [[AccountSignInItem alloc] initWithType:0]; |
+ UIImage* image = [[UIImage alloc] init]; |
+ |
+ item.image = image; |
+ |
+ id cell = [[[item cellClass] alloc] init]; |
+ ASSERT_TRUE([cell isMemberOfClass:[AccountSignInCell class]]); |
+ |
+ AccountSignInCell* signInCell = cell; |
+ EXPECT_FALSE(signInCell.imageView.image); |
+ |
+ [item configureCell:cell]; |
+ EXPECT_NSEQ(image, signInCell.imageView.image); |
+} |