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

Unified Diff: ios/chrome/browser/ui/ntp/centering_scrollview_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
« no previous file with comments | « ios/chrome/browser/ui/ntp/BUILD.gn ('k') | ios/chrome/browser/ui/ntp/google_landing_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/ntp/centering_scrollview_unittest.mm
diff --git a/ios/chrome/browser/ui/ntp/centering_scrollview_unittest.mm b/ios/chrome/browser/ui/ntp/centering_scrollview_unittest.mm
index d421ecde0ae673f6067bc31fc5b73fd4ad0de553..b78318207202563457250e70610f2f61401557c5 100644
--- a/ios/chrome/browser/ui/ntp/centering_scrollview_unittest.mm
+++ b/ios/chrome/browser/ui/ntp/centering_scrollview_unittest.mm
@@ -2,29 +2,32 @@
// 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/centering_scrollview.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gtest_mac.h"
#include "testing/platform_test.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
class CenteringScrollViewTest : public PlatformTest {
protected:
void SetUp() override {
- scrollView_.reset([[CenteringScrollView alloc] initWithFrame:CGRectZero]);
- contentView_.reset([[UIView alloc] initWithFrame:CGRectZero]);
+ scrollView_ = [[CenteringScrollView alloc] initWithFrame:CGRectZero];
+ contentView_ = [[UIView alloc] initWithFrame:CGRectZero];
};
- base::scoped_nsobject<CenteringScrollView> scrollView_;
- base::scoped_nsobject<UIView> contentView_;
+ CenteringScrollView* scrollView_;
+ UIView* contentView_;
};
TEST_F(CenteringScrollViewTest, CenteringContent) {
// Set up content view to be smaller than the scrolling view.
[contentView_ setFrame:CGRectMake(0.0, 0.0, 80.0, 120.0)];
- [scrollView_ addSubview:contentView_.get()];
+ [scrollView_ addSubview:contentView_];
// Do test.
[scrollView_ setFrame:CGRectMake(0.0, 0.0, 320, 480.0)];
[scrollView_ layoutSubviews];
@@ -42,7 +45,7 @@ TEST_F(CenteringScrollViewTest, CenteringContent) {
TEST_F(CenteringScrollViewTest, ScrollingContent) {
// Set up content view taller than the scrolling view.
[contentView_ setFrame:CGRectMake(0.0, 0.0, 240.0, 400.0)];
- [scrollView_ addSubview:contentView_.get()];
+ [scrollView_ addSubview:contentView_];
// Do test
[scrollView_ setFrame:CGRectMake(0.0, 0.0, 480.0, 320.0)];
[scrollView_ layoutSubviews];
@@ -60,7 +63,7 @@ TEST_F(CenteringScrollViewTest, ScrollingContent) {
TEST_F(CenteringScrollViewTest, ResetContentSize) {
// Set up content view taller than the scrolling view.
[contentView_ setFrame:CGRectMake(0.0, 0.0, 240.0, 400.0)];
- [scrollView_ addSubview:contentView_.get()];
+ [scrollView_ addSubview:contentView_];
[scrollView_ setFrame:CGRectMake(0.0, 0.0, 280.0, 440.0)];
[scrollView_ layoutSubviews];
« no previous file with comments | « ios/chrome/browser/ui/ntp/BUILD.gn ('k') | ios/chrome/browser/ui/ntp/google_landing_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698