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

Unified Diff: ios/web/public/origin_util_unittest.mm

Issue 2937503004: [ObjC ARC] Converts ios/web:ios_web_public_unittests to ARC. (Closed)
Patch Set: Created 3 years, 6 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/web/BUILD.gn ('k') | ios/web/public/serializable_user_data_manager_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/origin_util_unittest.mm
diff --git a/ios/web/public/origin_util_unittest.mm b/ios/web/public/origin_util_unittest.mm
index 79cae2b04e782e378ef6ad8e9d61793c75f23b3a..ec49ff11b30f362520f25ee17c409bdf5077ce36 100644
--- a/ios/web/public/origin_util_unittest.mm
+++ b/ios/web/public/origin_util_unittest.mm
@@ -6,11 +6,13 @@
#import <WebKit/WebKit.h>
-#import "base/mac/objc_property_releaser.h"
-#import "base/mac/scoped_nsobject.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
// WKSecurityOrigin can not be manually created, hence stub is needed.
@interface WKSecurityOriginStub : NSObject
// Methods from WKSecurityOrigin class.
@@ -19,18 +21,10 @@
@property(nonatomic) NSInteger port;
@end
-@implementation WKSecurityOriginStub {
- base::mac::ObjCPropertyReleaser _propertyReleaser;
-}
+@implementation WKSecurityOriginStub
@synthesize protocol = _protocol;
@synthesize host = _host;
@synthesize port = _port;
-- (instancetype)init {
- if (self = [super init]) {
- _propertyReleaser.Init(self, [WKSecurityOriginStub class]);
- }
- return self;
-}
@end
namespace web {
@@ -45,14 +39,13 @@ TEST(OriginUtilTest, GURLOriginWithNilWKSecurityOrigin) {
// Tests calling GURLOriginWithWKSecurityOrigin with valid origin.
TEST(OriginUtilTest, GURLOriginWithValidWKSecurityOrigin) {
- base::scoped_nsobject<WKSecurityOriginStub> origin(
- [[WKSecurityOriginStub alloc] init]);
+ WKSecurityOriginStub* origin = [[WKSecurityOriginStub alloc] init];
[origin setProtocol:@"http"];
[origin setHost:@"chromium.org"];
[origin setPort:80];
- GURL url(GURLOriginWithWKSecurityOrigin(
- static_cast<WKSecurityOrigin*>(origin.get())));
+ GURL url(
+ GURLOriginWithWKSecurityOrigin(static_cast<WKSecurityOrigin*>(origin)));
EXPECT_EQ("http://chromium.org/", url.spec());
EXPECT_TRUE(url.port().empty());
}
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/public/serializable_user_data_manager_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698