Chromium Code Reviews| Index: components/offline_items_collection/core/test_support/scoped_mock_offline_content_provider.h |
| diff --git a/components/offline_items_collection/core/test_support/scoped_mock_offline_content_provider.h b/components/offline_items_collection/core/test_support/scoped_mock_offline_content_provider.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d88b2ace5e13f49c65f81292ef1974fbdc66006d |
| --- /dev/null |
| +++ b/components/offline_items_collection/core/test_support/scoped_mock_offline_content_provider.h |
| @@ -0,0 +1,40 @@ |
| +// 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. |
| + |
| +#ifndef COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_TEST_SUPPORT_SCOPED_MOCK_OFFLINE_CONTENT_PROVIDER_H_ |
| +#define COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_TEST_SUPPORT_SCOPED_MOCK_OFFLINE_CONTENT_PROVIDER_H_ |
| + |
| +#include "components/offline_items_collection/core/test_support/mock_offline_content_provider.h" |
| + |
| +namespace offline_items_collection { |
| + |
| +class OfflineContentAggregator; |
| +class OfflineContentProvider; |
| + |
| +class ScopedMockOfflineContentProvider : public MockOfflineContentProvider { |
| + public: |
| + class ScopedMockObserver : public MockObserver { |
| + public: |
| + ScopedMockObserver(OfflineContentProvider* provider); |
|
dcheng
2017/03/03 08:59:45
Nit: explicit
David Trainor- moved to gerrit
2017/03/03 09:42:01
Done.
|
| + ~ScopedMockObserver() override; |
| + |
| + private: |
| + OfflineContentProvider* const provider_; |
| + }; |
| + |
| + ScopedMockOfflineContentProvider(const std::string& name_space, |
| + OfflineContentAggregator* aggregator); |
| + ~ScopedMockOfflineContentProvider() override; |
| + |
| + protected: |
| + void Unregister(); |
| + |
| + private: |
| + const std::string name_space_; |
| + OfflineContentAggregator* aggregator_; |
| +}; |
| + |
| +} // namespace offline_items_collection |
| + |
| +#endif // COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_TEST_SUPPORT_SCOPED_MOCK_OFFLINE_CONTENT_PROVIDER_H_ |