| 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];
|
|
|