Index: ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller_unittest.mm |
diff --git a/ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller_unittest.mm b/ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller_unittest.mm |
index 46d66aa3219acacf5866d713de82b9eb2c9d09a1..59d76fd951b938691eb501e261e4f0564f0d1ec6 100644 |
--- a/ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller_unittest.mm |
+++ b/ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller_unittest.mm |
@@ -6,7 +6,6 @@ |
#include <memory> |
-#include "base/mac/scoped_nsobject.h" |
#include "components/metrics/metrics_pref_names.h" |
#include "components/prefs/pref_registry_simple.h" |
#include "components/prefs/testing_pref_service.h" |
@@ -24,6 +23,10 @@ |
#include "third_party/ocmock/OCMock/OCMock.h" |
#include "third_party/ocmock/gtest_support.h" |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
@interface WelcomeToChromeView (ExposedForTesting) |
@property(nonatomic, retain, readonly) UIButton* checkBoxButton; |
- (void)checkBoxButtonWasTapped; |
@@ -38,21 +41,21 @@ class WelcomeToChromeViewControllerTest : public PlatformTest { |
TestChromeBrowserState::Builder test_cbs_builder; |
chrome_browser_state_ = test_cbs_builder.Build(); |
id tabModel = [OCMockObject mockForClass:[TabModel class]]; |
- controller_.reset([[WelcomeToChromeViewController alloc] |
+ controller_ = [[WelcomeToChromeViewController alloc] |
initWithBrowserState:chrome_browser_state_.get() |
- tabModel:tabModel]); |
+ tabModel:tabModel]; |
[controller_ loadView]; |
} |
void TearDown() override { |
- controller_.reset(); |
+ controller_ = nil; |
PlatformTest::TearDown(); |
} |
web::TestWebThreadBundle thread_bundle_; |
IOSChromeScopedTestingLocalState local_state_; |
std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; |
- base::scoped_nsobject<WelcomeToChromeViewController> controller_; |
+ WelcomeToChromeViewController* controller_; |
}; |
TEST_F(WelcomeToChromeViewControllerTest, TestDefaultStatsCheckBoxValue) { |
@@ -62,7 +65,7 @@ TEST_F(WelcomeToChromeViewControllerTest, TestDefaultStatsCheckBoxValue) { |
} |
TEST_F(WelcomeToChromeViewControllerTest, TestConstructorDestructor) { |
- EXPECT_TRUE(controller_.get()); |
+ EXPECT_TRUE(controller_); |
EXPECT_TRUE([controller_ view]); |
} |