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

Unified Diff: ios/chrome/browser/ui/history/history_entries_status_item_unittest.mm

Issue 2650423002: [ObjC ARC] Converts ios/chrome/browser/ui/history:unit_tests to ARC. (Closed)
Patch Set: comments Created 3 years, 7 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/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;

Powered by Google App Engine
This is Rietveld 408576698