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

Unified Diff: ios/web/navigation/crw_navigation_item_storage_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/BUILD.gn ('k') | ios/web/navigation/crw_session_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/crw_navigation_item_storage_unittest.mm
diff --git a/ios/web/navigation/crw_navigation_item_storage_unittest.mm b/ios/web/navigation/crw_navigation_item_storage_unittest.mm
index 4f107018bda2e5c8bebdd496aab7cfe9a5e3ad0c..7581aa97f57047e7f2e9b92f6f4aeec7d5c741ac 100644
--- a/ios/web/navigation/crw_navigation_item_storage_unittest.mm
+++ b/ios/web/navigation/crw_navigation_item_storage_unittest.mm
@@ -9,7 +9,6 @@
#include <utility>
-#import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/web/navigation/navigation_item_impl.h"
#import "ios/web/navigation/navigation_item_storage_test_util.h"
@@ -21,6 +20,10 @@
#include "third_party/ocmock/gtest_support.h"
#include "ui/base/page_transition_types.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
class CRWNavigationItemStorageTest : public PlatformTest {
protected:
CRWNavigationItemStorageTest()
@@ -43,7 +46,7 @@ class CRWNavigationItemStorageTest : public PlatformTest {
CRWNavigationItemStorage* item_storage() { return item_storage_; }
protected:
- base::scoped_nsobject<CRWNavigationItemStorage> item_storage_;
+ CRWNavigationItemStorage* item_storage_;
};
// Tests initializing with the legacy keys.
@@ -55,9 +58,9 @@ TEST_F(CRWNavigationItemStorageTest, InitWithCoderLegacy) {
item_storage().timestamp = base::Time::FromCFAbsoluteTime(0);
// Set up archiver and unarchiver.
- base::scoped_nsobject<NSMutableData> data([[NSMutableData alloc] init]);
- base::scoped_nsobject<NSKeyedArchiver> archiver(
- [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]);
+ NSMutableData* data = [[NSMutableData alloc] init];
+ NSKeyedArchiver* archiver =
+ [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
[archiver encodeObject:virtualURL
forKey:web::kNavigationItemStorageURLDeperecatedKey];
[archiver encodeObject:referrerURL
@@ -81,13 +84,13 @@ TEST_F(CRWNavigationItemStorageTest, InitWithCoderLegacy) {
encodeBool:skip_repost_form_confirmation
forKey:web::kNavigationItemStorageSkipRepostFormConfirmationKey];
[archiver finishEncoding];
- base::scoped_nsobject<NSKeyedUnarchiver> unarchiver(
- [[NSKeyedUnarchiver alloc] initForReadingWithData:data]);
+ NSKeyedUnarchiver* unarchiver =
+ [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
// Create a CRWNavigationItemStorage and verify that it is equivalent.
- base::scoped_nsobject<CRWNavigationItemStorage> new_storage(
- [[CRWNavigationItemStorage alloc] initWithCoder:unarchiver]);
- EXPECT_TRUE(web::ItemStoragesAreEqual(item_storage(), new_storage.get()));
+ CRWNavigationItemStorage* new_storage =
+ [[CRWNavigationItemStorage alloc] initWithCoder:unarchiver];
+ EXPECT_TRUE(web::ItemStoragesAreEqual(item_storage(), new_storage));
}
// Tests that unarchiving CRWNavigationItemStorage data results in an equivalent
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/navigation/crw_session_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698