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

Unified Diff: ios/chrome/browser/snapshots/lru_cache_unittest.mm

Issue 2928423002: [ObjC ARC] Converts ios/chrome/browser/snapshots:unit_tests to ARC. (Closed)
Patch Set: Remove spurious files. 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/chrome/browser/snapshots/BUILD.gn ('k') | ios/chrome/browser/snapshots/snapshot_cache_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/snapshots/lru_cache_unittest.mm
diff --git a/ios/chrome/browser/snapshots/lru_cache_unittest.mm b/ios/chrome/browser/snapshots/lru_cache_unittest.mm
index ef0b920ad87b019d455f8190f4e55af5cfcb521e..31b322003b9de4a2d4560b7e2528f9772131bd03 100644
--- a/ios/chrome/browser/snapshots/lru_cache_unittest.mm
+++ b/ios/chrome/browser/snapshots/lru_cache_unittest.mm
@@ -2,23 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "base/mac/scoped_nsobject.h"
#import "ios/chrome/browser/snapshots/lru_cache.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
TEST(LRUCacheTest, Basic) {
- base::scoped_nsobject<LRUCache> cache([[LRUCache alloc] initWithCacheSize:3]);
+ LRUCache* cache = [[LRUCache alloc] initWithCacheSize:3];
- base::scoped_nsobject<NSString> value1(
- [[NSString alloc] initWithString:@"Value 1"]);
- base::scoped_nsobject<NSString> value2(
- [[NSString alloc] initWithString:@"Value 2"]);
- base::scoped_nsobject<NSString> value3(
- [[NSString alloc] initWithString:@"Value 3"]);
- base::scoped_nsobject<NSString> value4(
- [[NSString alloc] initWithString:@"Value 4"]);
+ NSString* value1 = @"Value 1";
+ NSString* value2 = @"Value 2";
+ NSString* value3 = @"Value 3";
+ NSString* value4 = @"Value 4";
EXPECT_TRUE([cache count] == 0);
EXPECT_TRUE([cache isEmpty]);
@@ -36,7 +35,7 @@ TEST(LRUCacheTest, Basic) {
EXPECT_TRUE(value == nil);
value = [cache objectForKey:@"VALUE 2"];
- EXPECT_TRUE(value == value2.get());
+ EXPECT_TRUE(value == value2);
// Removing a non existing key shouldn't do anything.
[cache removeObjectForKey:@"XXX"];
« no previous file with comments | « ios/chrome/browser/snapshots/BUILD.gn ('k') | ios/chrome/browser/snapshots/snapshot_cache_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698