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

Unified Diff: ios/chrome/test/base/scoped_block_swizzler_unittest.mm

Issue 2887563002: [ObjC ARC] Converts ios/chrome/test/base:unit_tests to ARC. (Closed)
Patch Set: Created 3 years, 7 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/chrome/test/base/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/test/base/scoped_block_swizzler_unittest.mm
diff --git a/ios/chrome/test/base/scoped_block_swizzler_unittest.mm b/ios/chrome/test/base/scoped_block_swizzler_unittest.mm
index 9cbd66915cc1fd0b6359b5d3872fc12f6c38bbce..111cf104f95be9f0b4ba6e1aa2807694f4add133 100644
--- a/ios/chrome/test/base/scoped_block_swizzler_unittest.mm
+++ b/ios/chrome/test/base/scoped_block_swizzler_unittest.mm
@@ -3,12 +3,15 @@
// found in the LICENSE file.
#include "base/mac/foundation_util.h"
-#import "base/mac/scoped_nsobject.h"
#include "ios/chrome/test/base/scoped_block_swizzler.h"
#include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
// Class containing two methods that will be swizzled by the unittests.
@interface ScopedBlockSwizzlerTestClass : NSObject
@@ -45,9 +48,9 @@ ScopedBlockSwizzler swizzler([ScopedBlockSwizzlerTestClass class],
// Tests that swizzling an instance method works properly.
TEST(ScopedBlockSwizzlerTest, SwizzlingInstanceMethod) {
- base::scoped_nsobject<ScopedBlockSwizzlerTestClass> target(
- [[ScopedBlockSwizzlerTestClass alloc] init]);
- target.get().value = kSwizzledInstanceValue;
+ ScopedBlockSwizzlerTestClass* target =
+ [[ScopedBlockSwizzlerTestClass alloc] init];
+ target.value = kSwizzledInstanceValue;
EXPECT_NSEQ(kOriginalInstanceValue, [target instanceMethodToSwizzle]);
EXPECT_FALSE([[target instanceMethodToSwizzle]
« no previous file with comments | « ios/chrome/test/base/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698