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

Unified Diff: ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm

Issue 2914303002: [ObjC ARC] Converts ios/chrome/browser/ui/reading_list:unit_tests to ARC. (Closed)
Patch Set: Use pragma to suppress performSelector ARC warning 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
Index: ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm
diff --git a/ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm b/ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm
index abc5dd5ec2a8bde10ded78216b79dd16e36b7421..d0c556e2cfe6d56954597086746b88b9dd0f6e7c 100644
--- a/ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm
+++ b/ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm
@@ -6,7 +6,6 @@
#include <memory>
-#import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
#include "ios/chrome/browser/reading_list/offline_url_utils.h"
@@ -21,6 +20,10 @@
#import "third_party/ocmock/OCMock/OCMock.h"
#include "third_party/ocmock/gtest_support.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
class OfflinePageNativeContentTest : public web::WebTestWithWebState {
protected:
void SetUp() override {
@@ -38,12 +41,11 @@ TEST_F(OfflinePageNativeContentTest, BasicOfflinePageTest) {
GURL url = reading_list::OfflineURLForPath(
base::FilePath("offline_id/page.html"), entry_url, distilled_url);
id<UrlLoader> loader = [OCMockObject mockForProtocol:@protocol(UrlLoader)];
- base::scoped_nsobject<OfflinePageNativeContent> content(
- [[OfflinePageNativeContent alloc]
- initWithLoader:loader
- browserState:chrome_browser_state_.get()
- webState:web_state()
- URL:url]);
+ OfflinePageNativeContent* content = [[OfflinePageNativeContent alloc]
+ initWithLoader:loader
+ browserState:chrome_browser_state_.get()
+ webState:web_state()
+ URL:url];
ASSERT_EQ(url, [content url]);
ASSERT_EQ(distilled_url, [content virtualURL]);
ASSERT_OCMOCK_VERIFY((OCMockObject*)loader);
@@ -63,12 +65,11 @@ TEST_F(OfflinePageNativeContentTest, DismissOfflineContent) {
GURL url = reading_list::OfflineURLForPath(
base::FilePath("offline_id/page.html"), entry_url, virtual_url);
id<UrlLoader> loader = [OCMockObject mockForProtocol:@protocol(UrlLoader)];
- base::scoped_nsobject<OfflinePageNativeContent> content(
- [[OfflinePageNativeContent alloc]
- initWithLoader:loader
- browserState:chrome_browser_state_.get()
- webState:web_state()
- URL:url]);
+ OfflinePageNativeContent* content = [[OfflinePageNativeContent alloc]
+ initWithLoader:loader
+ browserState:chrome_browser_state_.get()
+ webState:web_state()
+ URL:url];
ASSERT_EQ(url, [content url]);
ASSERT_EQ(virtual_url, [content virtualURL]);
ASSERT_OCMOCK_VERIFY((OCMockObject*)loader);

Powered by Google App Engine
This is Rietveld 408576698