| Index: ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm
|
| diff --git a/ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm b/ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm
|
| index 508f7bcdea1dbd6d57f293c56108a84d05847eb7..79ba5afe6ffb5ab2741b7b87c5cf52f7941960ed 100644
|
| --- a/ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm
|
| +++ b/ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm
|
| @@ -4,20 +4,23 @@
|
|
|
| #import "ios/chrome/browser/ui/commands/set_up_for_testing_command.h"
|
|
|
| -#include "base/mac/scoped_nsobject.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "testing/gtest_mac.h"
|
| #include "testing/platform_test.h"
|
| #include "url/gurl.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| namespace {
|
|
|
| typedef PlatformTest SetUpForTestingCommandTest;
|
|
|
| TEST_F(SetUpForTestingCommandTest, InitNoArguments) {
|
| GURL url("chrome://setupfortesting");
|
| - base::scoped_nsobject<SetUpForTestingCommand> command(
|
| - [[SetUpForTestingCommand alloc] initWithURL:url]);
|
| + SetUpForTestingCommand* command =
|
| + [[SetUpForTestingCommand alloc] initWithURL:url];
|
| EXPECT_FALSE([command clearBrowsingData]);
|
| EXPECT_FALSE([command closeTabs]);
|
| EXPECT_EQ(0, [command numberOfNewTabs]);
|
| @@ -25,8 +28,8 @@ TEST_F(SetUpForTestingCommandTest, InitNoArguments) {
|
|
|
| TEST_F(SetUpForTestingCommandTest, InitClearBrowsingData) {
|
| GURL url("chrome://setupfortesting?clearBrowsingData");
|
| - base::scoped_nsobject<SetUpForTestingCommand> command(
|
| - [[SetUpForTestingCommand alloc] initWithURL:url]);
|
| + SetUpForTestingCommand* command =
|
| + [[SetUpForTestingCommand alloc] initWithURL:url];
|
| EXPECT_TRUE([command clearBrowsingData]);
|
| EXPECT_FALSE([command closeTabs]);
|
| EXPECT_EQ(0, [command numberOfNewTabs]);
|
| @@ -34,8 +37,8 @@ TEST_F(SetUpForTestingCommandTest, InitClearBrowsingData) {
|
|
|
| TEST_F(SetUpForTestingCommandTest, InitCloseTabs) {
|
| GURL url("chrome://setupfortesting?closeTabs");
|
| - base::scoped_nsobject<SetUpForTestingCommand> command(
|
| - [[SetUpForTestingCommand alloc] initWithURL:url]);
|
| + SetUpForTestingCommand* command =
|
| + [[SetUpForTestingCommand alloc] initWithURL:url];
|
| EXPECT_FALSE([command clearBrowsingData]);
|
| EXPECT_TRUE([command closeTabs]);
|
| EXPECT_EQ(0, [command numberOfNewTabs]);
|
| @@ -43,8 +46,8 @@ TEST_F(SetUpForTestingCommandTest, InitCloseTabs) {
|
|
|
| TEST_F(SetUpForTestingCommandTest, InitNumberOfNewTabs) {
|
| GURL url("chrome://setupfortesting?numberOfNewTabs=3");
|
| - base::scoped_nsobject<SetUpForTestingCommand> command(
|
| - [[SetUpForTestingCommand alloc] initWithURL:url]);
|
| + SetUpForTestingCommand* command =
|
| + [[SetUpForTestingCommand alloc] initWithURL:url];
|
| EXPECT_FALSE([command clearBrowsingData]);
|
| EXPECT_FALSE([command closeTabs]);
|
| EXPECT_EQ(3, [command numberOfNewTabs]);
|
| @@ -52,8 +55,8 @@ TEST_F(SetUpForTestingCommandTest, InitNumberOfNewTabs) {
|
|
|
| TEST_F(SetUpForTestingCommandTest, InitWithBadNumberOfNewTabs) {
|
| GURL url("chrome://setupfortesting?numberOfNewTabs=a");
|
| - base::scoped_nsobject<SetUpForTestingCommand> command(
|
| - [[SetUpForTestingCommand alloc] initWithURL:url]);
|
| + SetUpForTestingCommand* command =
|
| + [[SetUpForTestingCommand alloc] initWithURL:url];
|
| EXPECT_FALSE([command clearBrowsingData]);
|
| EXPECT_FALSE([command closeTabs]);
|
| EXPECT_EQ(0, [command numberOfNewTabs]);
|
| @@ -61,8 +64,8 @@ TEST_F(SetUpForTestingCommandTest, InitWithBadNumberOfNewTabs) {
|
|
|
| TEST_F(SetUpForTestingCommandTest, InitWithNegativeNumberOfNewTabs) {
|
| GURL url("chrome://setupfortesting?numberOfNewTabs=-3");
|
| - base::scoped_nsobject<SetUpForTestingCommand> command(
|
| - [[SetUpForTestingCommand alloc] initWithURL:url]);
|
| + SetUpForTestingCommand* command =
|
| + [[SetUpForTestingCommand alloc] initWithURL:url];
|
| EXPECT_FALSE([command clearBrowsingData]);
|
| EXPECT_FALSE([command closeTabs]);
|
| EXPECT_EQ(0, [command numberOfNewTabs]);
|
| @@ -71,8 +74,8 @@ TEST_F(SetUpForTestingCommandTest, InitWithNegativeNumberOfNewTabs) {
|
| TEST_F(SetUpForTestingCommandTest, InitWithArguments) {
|
| GURL url(
|
| "chrome://setupfortesting?clearBrowsingData&closeTabs&numberOfNewTabs=5");
|
| - base::scoped_nsobject<SetUpForTestingCommand> command(
|
| - [[SetUpForTestingCommand alloc] initWithURL:url]);
|
| + SetUpForTestingCommand* command =
|
| + [[SetUpForTestingCommand alloc] initWithURL:url];
|
| EXPECT_TRUE([command clearBrowsingData]);
|
| EXPECT_TRUE([command closeTabs]);
|
| EXPECT_EQ(5, [command numberOfNewTabs]);
|
| @@ -80,8 +83,8 @@ TEST_F(SetUpForTestingCommandTest, InitWithArguments) {
|
|
|
| TEST_F(SetUpForTestingCommandTest, InitWithBadArguments) {
|
| GURL url("chrome://setupfortesting?badArg");
|
| - base::scoped_nsobject<SetUpForTestingCommand> command(
|
| - [[SetUpForTestingCommand alloc] initWithURL:url]);
|
| + SetUpForTestingCommand* command =
|
| + [[SetUpForTestingCommand alloc] initWithURL:url];
|
| EXPECT_FALSE([command clearBrowsingData]);
|
| EXPECT_FALSE([command closeTabs]);
|
| EXPECT_EQ(0, [command numberOfNewTabs]);
|
|
|