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

Unified Diff: ios/chrome/browser/ui/tab_switcher/tab_model_snapshot_unittest.mm

Issue 2689553002: [ObjC ARC] Converts ios/chrome/browser/ui/tab_switcher:unit_tests to ARC. (Closed)
Patch Set: Created 3 years, 10 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
Index: ios/chrome/browser/ui/tab_switcher/tab_model_snapshot_unittest.mm
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot_unittest.mm
index 44895310128e2f0dc61f0c2aaca041323fb15c29..ef8064d530c255f31fc40647b52b6b40ece298b1 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot_unittest.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot_unittest.mm
@@ -4,13 +4,16 @@
#import "ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.h"
-#import "base/mac/scoped_nsobject.h"
#import "ios/chrome/browser/tabs/tab.h"
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
@interface TabModelMock : NSObject<NSFastEnumeration> {
- base::scoped_nsobject<NSArray> tabs_;
+ NSArray* tabs_;
}
@end
@@ -18,13 +21,13 @@
- (id)initWithTabs:(NSArray*)tabs {
if ((self = [super init])) {
- tabs_.reset([tabs retain]);
+ tabs_ = tabs;
}
return self;
}
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState*)state
- objects:(id*)stackbuf
+ objects:(id __unsafe_unretained*)stackbuf
count:(NSUInteger)len {
return [tabs_ countByEnumeratingWithState:state objects:stackbuf count:len];
}
@@ -75,10 +78,9 @@ TEST_F(TabModelSnapshotTest, TestSnapshotHashes) {
Tab* tab1 = TabMock(@"id1", @"url1", 12345.6789);
Tab* tab2 = TabMock(@"id2", @"url1", 12345.6789);
- base::scoped_nsobject<TabModelMock> tabModel(
- [[TabModelMock alloc] initWithTabs:@[ tab1, tab2 ]]);
- TabModelSnapshot tabModelSnapshot((TabModel*)tabModel.get());
- tabModel.reset();
+ TabModelMock* tabModel = [[TabModelMock alloc] initWithTabs:@[ tab1, tab2 ]];
+ TabModelSnapshot tabModelSnapshot((TabModel*)tabModel);
+ tabModel = nil;
EXPECT_EQ(tabModelSnapshot.hashes().size(), 2UL);
EXPECT_EQ(tabModelSnapshot.hashes()[0],
« no previous file with comments | « ios/chrome/browser/ui/tab_switcher/BUILD.gn ('k') | ios/chrome/browser/ui/tab_switcher/tab_switcher_model_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698