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

Unified Diff: ios/chrome/browser/itunes_links/itunes_links_observer_unittest.mm

Issue 2560473002: [ObjC ARC] Converts ios/chrome/browser/itunes_links:unit_tests to ARC. (Closed)
Patch Set: git cl w Created 4 years 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/itunes_links/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/itunes_links/itunes_links_observer_unittest.mm
diff --git a/ios/chrome/browser/itunes_links/itunes_links_observer_unittest.mm b/ios/chrome/browser/itunes_links/itunes_links_observer_unittest.mm
index a72637059e2b3cd8b85fec1bdd1434382aa8a0dd..ddee126673b3214aefce752f1605ee885a576b85 100644
--- a/ios/chrome/browser/itunes_links/itunes_links_observer_unittest.mm
+++ b/ios/chrome/browser/itunes_links/itunes_links_observer_unittest.mm
@@ -6,7 +6,6 @@
#import "ios/chrome/browser/itunes_links/itunes_links_observer.h"
-#import "base/mac/scoped_nsobject.h"
#import "ios/web/public/test/test_web_state.h"
#import "ios/chrome/browser/storekit_launcher.h"
#include "testing/gtest_mac.h"
@@ -15,30 +14,38 @@
#import "third_party/ocmock/OCMock/OCMock.h"
#include "url/gurl.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
class ITunesLinksObserverTest : public PlatformTest {
protected:
void SetUp() override {
- mocked_store_kit_launcher_.reset(
- [[OCMockObject mockForProtocol:@protocol(StoreKitLauncher)] retain]);
- link_observer_.reset(
- [[ITunesLinksObserver alloc] initWithWebState:&web_state_]);
+ mocked_store_kit_launcher_ =
+ [OCMockObject mockForProtocol:@protocol(StoreKitLauncher)];
+ link_observer_ = [[ITunesLinksObserver alloc] initWithWebState:&web_state_];
[link_observer_ setStoreKitLauncher:mocked_store_kit_launcher_];
}
void VerifyOpeningOfAppStore(NSString* expected_product_id,
std::string const& url_string) {
if (expected_product_id)
- [[mocked_store_kit_launcher_.get() expect]
- openAppStore:expected_product_id];
+ [[mocked_store_kit_launcher_ expect] openAppStore:expected_product_id];
web_state_.SetCurrentURL(GURL(url_string));
[link_observer_ webStateDidLoadPage:&web_state_];
- EXPECT_OCMOCK_VERIFY(mocked_store_kit_launcher_.get());
+ EXPECT_OCMOCK_VERIFY(mocked_store_kit_launcher_);
+ }
+
+ void TearDown() override {
+ // |link_observer_| must be destroyed before web_state_.
+ link_observer_ = nil;
}
+
web::TestWebState web_state_;
- base::scoped_nsobject<id> mocked_store_kit_launcher_;
+ id mocked_store_kit_launcher_;
// |link_observer_| must be destroyed before web_state_.
- base::scoped_nsobject<ITunesLinksObserver> link_observer_;
+ ITunesLinksObserver* link_observer_;
};
// Verifies that navigating to URLs not concerning a product hosted on the
« no previous file with comments | « ios/chrome/browser/itunes_links/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698