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

Unified Diff: ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm

Issue 2511423002: [ObjC ARC] Converts ios/chrome/browser/ui/commands:unit_tests to ARC.Automatically generated ARCM… (Closed)
Patch Set: removed scoped nsobjects Created 4 years 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/commands/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]);
« no previous file with comments | « ios/chrome/browser/ui/commands/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698