Chromium Code Reviews| 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..feba20309b68e4fe0ba06a3886c8e5c7ceec39a6 |
| --- /dev/null |
| +++ b/ios/chrome/browser/store_kit/store_kit_tab_helper_unittest.mm |
| @@ -0,0 +1,38 @@ |
| +// 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 |
| + |
| +namespace { |
|
sdefresne
2017/03/07 01:43:26
nit, optional: there is no need to put test code i
pkl (ping after 24h if needed)
2017/03/07 02:10:02
Done, removed anonymous namespace.
|
| + |
| +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()); |
| +} |
| + |
| +} // namespace |