| Index: ios/chrome/browser/ui/history/history_entries_status_item_unittest.mm
|
| diff --git a/ios/chrome/browser/ui/history/history_entries_status_item_unittest.mm b/ios/chrome/browser/ui/history/history_entries_status_item_unittest.mm
|
| index 4c8ea460785931692b7b5e80c3ebdb1a28ce400a..130a919ecadafba7fb9065d4ec084dec3ced647e 100644
|
| --- a/ios/chrome/browser/ui/history/history_entries_status_item_unittest.mm
|
| +++ b/ios/chrome/browser/ui/history/history_entries_status_item_unittest.mm
|
| @@ -19,6 +19,10 @@
|
| #include "ui/base/l10n/l10n_util_mac.h"
|
| #include "url/gurl.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| // Mock delegate for HistoryEntriesStatusItem. Implement mock delegate rather
|
| // than use OCMock because delegate method takes a GURL as a parameter.
|
| @interface MockEntriesStatusItemDelegate
|
| @@ -50,10 +54,9 @@ namespace {
|
| // property set to YES results in an empty label.
|
| TEST(HistoryEntriesStatusItemTest, TestHidden) {
|
| HistoryEntriesStatusItem* item =
|
| - [[[HistoryEntriesStatusItem alloc] initWithType:0] autorelease];
|
| + [[HistoryEntriesStatusItem alloc] initWithType:0];
|
| item.hidden = YES;
|
| - HistoryEntriesStatusCell* cell =
|
| - [[[HistoryEntriesStatusCell alloc] init] autorelease];
|
| + HistoryEntriesStatusCell* cell = [[HistoryEntriesStatusCell alloc] init];
|
| [item configureCell:cell];
|
| EXPECT_FALSE(cell.textLabel.text);
|
| }
|
| @@ -62,9 +65,8 @@ TEST(HistoryEntriesStatusItemTest, TestHidden) {
|
| // possible HistoryEntriesStatus values shows a label with the correct text.
|
| TEST(HistoryEntriesStatusItemTest, TestEntriesStatus) {
|
| HistoryEntriesStatusItem* item =
|
| - [[[HistoryEntriesStatusItem alloc] initWithType:0] autorelease];
|
| - HistoryEntriesStatusCell* cell =
|
| - [[[HistoryEntriesStatusCell alloc] init] autorelease];
|
| + [[HistoryEntriesStatusItem alloc] initWithType:0];
|
| + HistoryEntriesStatusCell* cell = [[HistoryEntriesStatusCell alloc] init];
|
| NSRange range;
|
|
|
| item.entriesStatus = NO_ENTRIES;
|
| @@ -92,9 +94,8 @@ TEST(HistoryEntriesStatusItemTest, TestEntriesStatus) {
|
| // data text to the label.
|
| TEST(HistoryEntriesStatusItemTest, TestOtherBrowsingDataNotice) {
|
| HistoryEntriesStatusItem* item =
|
| - [[[HistoryEntriesStatusItem alloc] initWithType:0] autorelease];
|
| - HistoryEntriesStatusCell* cell =
|
| - [[[HistoryEntriesStatusCell alloc] init] autorelease];
|
| + [[HistoryEntriesStatusItem alloc] initWithType:0];
|
| + HistoryEntriesStatusCell* cell = [[HistoryEntriesStatusCell alloc] init];
|
| item.hidden = NO;
|
| item.entriesStatus = SYNCED_ENTRIES;
|
| item.showsOtherBrowsingDataNotice = YES;
|
| @@ -114,11 +115,10 @@ TEST(HistoryEntriesStatusItemTest, TestOtherBrowsingDataNotice) {
|
| // the HistoryEntriesStatusItemDelegate method.
|
| TEST(HistoryEntriesStatusItemTest, TestDelegate) {
|
| HistoryEntriesStatusItem* item =
|
| - [[[HistoryEntriesStatusItem alloc] initWithType:0] autorelease];
|
| - HistoryEntriesStatusCell* cell =
|
| - [[[HistoryEntriesStatusCell alloc] init] autorelease];
|
| + [[HistoryEntriesStatusItem alloc] initWithType:0];
|
| + HistoryEntriesStatusCell* cell = [[HistoryEntriesStatusCell alloc] init];
|
| MockEntriesStatusItemDelegate* delegate =
|
| - [[[MockEntriesStatusItemDelegate alloc] init] autorelease];
|
| + [[MockEntriesStatusItemDelegate alloc] init];
|
| item.delegate = delegate;
|
| item.hidden = NO;
|
| item.entriesStatus = SYNCED_ENTRIES;
|
|
|