Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1441)

Unified Diff: ios/chrome/browser/ui/authentication/signin_promo_view_unittest.mm

Issue 2749703003: Adding mediator for Sign-in promo (Closed)
Patch Set: Fixing Louis' comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/authentication/signin_promo_view_unittest.mm
diff --git a/ios/chrome/browser/ui/authentication/signin_promo_view_unittest.mm b/ios/chrome/browser/ui/authentication/signin_promo_view_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..c2409fa6e9666f689b443b57640ac7a99fdef66f
--- /dev/null
+++ b/ios/chrome/browser/ui/authentication/signin_promo_view_unittest.mm
@@ -0,0 +1,30 @@
+// Copyright 2017 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/authentication/signin_promo_view.h"
+
+#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h"
+#include "third_party/ocmock/gtest_support.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+TEST(SigninPromoViewTest, ChangeProfileImageInColdState) {
+ SigninPromoView* view =
+ [[SigninPromoView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
+ view.mode = SigninPromoViewColdStateMode;
+ UIImage* chromeImage = view.imageView.image;
+ [view setProfileImage:[[UIImage alloc] init]];
+ EXPECT_EQ(chromeImage, view.imageView.image);
+}
+
+TEST(SigninPromoViewTest, SecondaryButtonVisibility) {
+ SigninPromoView* view =
+ [[SigninPromoView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
+ view.mode = SigninPromoViewColdStateMode;
+ EXPECT_TRUE(view.secondaryButton.hidden);
+ view.mode = SigninPromoViewWarmStateMode;
+ EXPECT_FALSE(view.secondaryButton.hidden);
+}

Powered by Google App Engine
This is Rietveld 408576698