| 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());
|
| }
|
|
|