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

Unified Diff: ios/chrome/browser/store_kit/store_kit_tab_helper_unittest.mm

Issue 2731553005: Introduced StoreKitTabHelper class (Closed)
Patch Set: rebase Created 3 years, 9 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/store_kit/store_kit_tab_helper_unittest.mm
diff --git a/ios/chrome/browser/store_kit/store_kit_tab_helper_unittest.mm b/ios/chrome/browser/store_kit/store_kit_tab_helper_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..0075c9c87e73a1dcf585567f18e35dbd8f305119
--- /dev/null
+++ b/ios/chrome/browser/store_kit/store_kit_tab_helper_unittest.mm
@@ -0,0 +1,34 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/store_kit/store_kit_tab_helper.h"
+
+#include "base/macros.h"
+#import "ios/web/public/test/web_test_with_web_state.h"
+#import "third_party/ocmock/OCMock/OCMock.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+class StoreKitTabHelperTest : public web::WebTestWithWebState {
+ public:
+ StoreKitTabHelperTest() = default;
+ ~StoreKitTabHelperTest() override = default;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(StoreKitTabHelperTest);
+};
+
+TEST_F(StoreKitTabHelperTest, Constructor) {
+ StoreKitTabHelper::CreateForWebState(web_state());
+ StoreKitTabHelper* tab_helper = StoreKitTabHelper::FromWebState(web_state());
+ ASSERT_TRUE(tab_helper);
+
+ id mock_launcher =
+ [OCMockObject niceMockForProtocol:@protocol(StoreKitLauncher)];
+ // Verifies that GetLauncher returns the mock launcher object that was set.
+ tab_helper->SetLauncher(mock_launcher);
+ EXPECT_EQ(mock_launcher, tab_helper->GetLauncher());
+}

Powered by Google App Engine
This is Rietveld 408576698