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

Unified Diff: ios/chrome/browser/ui/history/history_entry_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_entry_item_unittest.mm
diff --git a/ios/chrome/browser/ui/history/history_entry_item_unittest.mm b/ios/chrome/browser/ui/history/history_entry_item_unittest.mm
index 28f8423460f154ae6e900e929d7e800e6f4c0570..9a86ef07298bdfc544f6d4dba5130a407d102f15 100644
--- a/ios/chrome/browser/ui/history/history_entry_item_unittest.mm
+++ b/ios/chrome/browser/ui/history/history_entry_item_unittest.mm
@@ -5,7 +5,6 @@
#import "ios/chrome/browser/ui/history/history_entry_item.h"
#include "base/i18n/time_formatting.h"
-#include "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
@@ -13,6 +12,10 @@
#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
+
namespace {
const char kTestUrl[] = "http://test/";
const char kTestUrl2[] = "http://test2/";
@@ -25,11 +28,10 @@ HistoryEntryItem* GetHistoryEntryItem(const GURL& url,
history::HistoryEntry entry = history::HistoryEntry(
history::HistoryEntry::LOCAL_ENTRY, GURL(url), base::UTF8ToUTF16(title),
timestamp, "", false, base::string16(), false);
- HistoryEntryItem* item =
- [[[HistoryEntryItem alloc] initWithType:0
- historyEntry:entry
- browserState:nil
- delegate:nil] autorelease];
+ HistoryEntryItem* item = [[HistoryEntryItem alloc] initWithType:0
+ historyEntry:entry
+ browserState:nil
+ delegate:nil];
return item;
}
@@ -41,14 +43,13 @@ TEST(HistoryEntryItemTest, ConfigureCell) {
HistoryEntryItem* item =
GetHistoryEntryItem(GURL(kTestUrl), kTestTitle, timestamp);
- base::scoped_nsobject<HistoryEntryCell> cell([[[item cellClass] alloc] init]);
+ HistoryEntryCell* cell = [[[item cellClass] alloc] init];
EXPECT_TRUE([cell isMemberOfClass:[HistoryEntryCell class]]);
[item configureCell:cell];
- EXPECT_NSEQ(base::SysUTF8ToNSString(kTestTitle), cell.get().textLabel.text);
- EXPECT_NSEQ(base::SysUTF8ToNSString(kTestUrl),
- cell.get().detailTextLabel.text);
+ EXPECT_NSEQ(base::SysUTF8ToNSString(kTestTitle), cell.textLabel.text);
+ EXPECT_NSEQ(base::SysUTF8ToNSString(kTestUrl), cell.detailTextLabel.text);
EXPECT_NSEQ(base::SysUTF16ToNSString(base::TimeFormatTimeOfDay(timestamp)),
- cell.get().timeLabel.text);
+ cell.timeLabel.text);
}
// Tests that -[HistoryItem isEqualToHistoryItem:] returns YES if the two items

Powered by Google App Engine
This is Rietveld 408576698