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

Unified Diff: ios/chrome/browser/ui/ntp/most_visited_cell_unittest.mm

Issue 2686623007: [ObjC ARC] Converts ios/chrome/browser/ui/ntp:unit_tests to ARC. (Closed)
Patch Set: Created 3 years, 10 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/ntp/most_visited_cell_unittest.mm
diff --git a/ios/chrome/browser/ui/ntp/most_visited_cell_unittest.mm b/ios/chrome/browser/ui/ntp/most_visited_cell_unittest.mm
index 9e12b2bab31037c2754a8aec8d52f802f76d267b..3c494ef20ee54414e9c84ef13f8009da0b710abc 100644
--- a/ios/chrome/browser/ui/ntp/most_visited_cell_unittest.mm
+++ b/ios/chrome/browser/ui/ntp/most_visited_cell_unittest.mm
@@ -2,24 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/mac/scoped_nsobject.h"
#import "ios/chrome/browser/ui/ntp/most_visited_cell.h"
#include "testing/platform_test.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
static NSString* title = @"Most Visited Cell Title";
const GURL URL = GURL("http://example.com");
// Fixture to test MostVisitedCell.
class MostVisitedCellTest : public PlatformTest {
protected:
- base::scoped_nsobject<MostVisitedCell> cell_;
+ MostVisitedCell* cell_;
};
TEST_F(MostVisitedCellTest, TestConstructor) {
CGRect rect = CGRectMake(0, 0, 100, 100);
- cell_.reset([[MostVisitedCell alloc] initWithFrame:rect]);
+ cell_ = [[MostVisitedCell alloc] initWithFrame:rect];
[cell_ setURL:URL];
- EXPECT_TRUE(cell_.get());
+ EXPECT_TRUE(cell_);
UIGraphicsBeginImageContext([cell_ bounds].size);
[cell_ drawRect:[cell_ bounds]];
UIGraphicsEndImageContext();
@@ -28,7 +31,7 @@ TEST_F(MostVisitedCellTest, TestConstructor) {
TEST_F(MostVisitedCellTest, ValidateTitle) {
CGRect rect = CGRectMake(0, 0, 100, 100);
- cell_.reset([[MostVisitedCell alloc] initWithFrame:rect]);
+ cell_ = [[MostVisitedCell alloc] initWithFrame:rect];
[cell_ setText:title];
EXPECT_EQ(title, [cell_ accessibilityLabel]);
}

Powered by Google App Engine
This is Rietveld 408576698