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/copied_to_chrome_item.h" |
| 6 |
| 7 #include "components/strings/grit/components_strings.h" |
| 8 #include "ios/chrome/grit/ios_chromium_strings.h" |
| 9 #import "ios/third_party/material_components_ios/src/components/Buttons/src/Mate
rialButtons.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "testing/gtest_mac.h" |
| 12 #include "ui/base/l10n/l10n_util_mac.h" |
| 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
| 18 namespace { |
| 19 |
| 20 // Tests that the cell created out of a CopiedToChromeItem is set up properly. |
| 21 TEST(CopiedToChromeItemTest, InitializeCell) { |
| 22 CopiedToChromeItem* item = [[CopiedToChromeItem alloc] initWithType:0]; |
| 23 |
| 24 id cell = [[[item cellClass] alloc] init]; |
| 25 ASSERT_TRUE([cell isMemberOfClass:[CopiedToChromeCell class]]); |
| 26 |
| 27 CopiedToChromeCell* copiedToChromeCell = cell; |
| 28 EXPECT_NSEQ(l10n_util::GetNSString(IDS_IOS_AUTOFILL_DESCRIBE_LOCAL_COPY), |
| 29 copiedToChromeCell.textLabel.text); |
| 30 EXPECT_NSEQ([l10n_util::GetNSString(IDS_AUTOFILL_CLEAR_LOCAL_COPY_BUTTON) |
| 31 uppercaseString], |
| 32 [copiedToChromeCell.button titleForState:UIControlStateNormal]); |
| 33 } |
| 34 |
| 35 } // namespace |
OLD | NEW |