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

Unified Diff: ios/web/navigation/nscoder_util_unittest.mm

Issue 2935983002: [ObjC ARC] Converts ios/web:ios_web_navigation_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/navigation/navigation_manager_impl_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/nscoder_util_unittest.mm
diff --git a/ios/web/navigation/nscoder_util_unittest.mm b/ios/web/navigation/nscoder_util_unittest.mm
index 2d63b348cb81e3afcbe150b025c88696ccf6a142..8a84ad27f4a4f380d169ba707d94db5875aa7719 100644
--- a/ios/web/navigation/nscoder_util_unittest.mm
+++ b/ios/web/navigation/nscoder_util_unittest.mm
@@ -5,12 +5,15 @@
#import <Foundation/Foundation.h>
#include <stddef.h>
-#import "base/mac/scoped_nsobject.h"
#include "base/macros.h"
#import "ios/web/navigation/nscoder_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace web {
namespace {
@@ -29,13 +32,13 @@ TEST_F(NSCoderStdStringTest, encodeDecode) {
for (size_t i = 0; i < arraysize(testStrings); ++i) {
NSMutableData* data = [NSMutableData data];
- base::scoped_nsobject<NSKeyedArchiver> archiver(
- [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]);
+ NSKeyedArchiver* archiver =
+ [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
nscoder_util::EncodeString(archiver, @"test", testStrings[i]);
[archiver finishEncoding];
- base::scoped_nsobject<NSKeyedUnarchiver> unarchiver(
- [[NSKeyedUnarchiver alloc] initForReadingWithData:data]);
+ NSKeyedUnarchiver* unarchiver =
+ [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
const std::string decoded = nscoder_util::DecodeString(unarchiver, @"test");
EXPECT_EQ(decoded, testStrings[i]);
@@ -45,12 +48,12 @@ TEST_F(NSCoderStdStringTest, encodeDecode) {
TEST_F(NSCoderStdStringTest, decodeEmpty) {
NSMutableData* data = [NSMutableData data];
- base::scoped_nsobject<NSKeyedArchiver> archiver(
- [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]);
+ NSKeyedArchiver* archiver =
+ [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
[archiver finishEncoding];
- base::scoped_nsobject<NSKeyedUnarchiver> unarchiver(
- [[NSKeyedUnarchiver alloc] initForReadingWithData:data]);
+ NSKeyedUnarchiver* unarchiver =
+ [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
const std::string decoded = nscoder_util::DecodeString(unarchiver, @"test");
EXPECT_EQ(decoded, "");
« no previous file with comments | « ios/web/navigation/navigation_manager_impl_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698