#include "components/offline_items_collection/core/offline_content_aggregator.h"
#include <map>
#include "base/functional/bind.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/test_mock_time_task_runner.h"
#include "components/offline_items_collection/core/offline_item.h"
#include "components/offline_items_collection/core/test_support/mock_offline_content_provider.h"
#include "components/offline_items_collection/core/test_support/scoped_mock_offline_content_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
ContainerEq;
Eq;
Return;
namespace offline_items_collection {
namespace {
GetVisualsOptions;
struct CompareOfflineItemsById { … };
template <typename T>
bool VectorContentsEq(const std::vector<T>& list1,
const std::vector<T>& list2) { … }
MATCHER_P(OpenParamsEqual, params, "") { … }
class OpenItemRemovalOfflineContentProvider
: public ScopedMockOfflineContentProvider { … };
class DelayedGetAllItemOfflineContentProvider
: public ScopedMockOfflineContentProvider { … };
class OfflineContentAggregatorTest : public testing::Test { … };
void OfflineContentAggregatorTest::GetAllItemsAndVerify(
OfflineContentProvider* provider,
const OfflineContentProvider::OfflineItemList& expected) { … }
void OfflineContentAggregatorTest::GetSingleItemAndVerify(
OfflineContentProvider* provider,
const ContentId& id,
const std::optional<OfflineItem>& expected) { … }
TEST_F(OfflineContentAggregatorTest, QueryingItemsWith2Providers) { … }
TEST_F(OfflineContentAggregatorTest, QueryingItemFromRemovedProvider) { … }
TEST_F(OfflineContentAggregatorTest, GetItemByIdPropagatesToRightProvider) { … }
TEST_F(OfflineContentAggregatorTest, ActionPropagatesToRightProvider) { … }
TEST_F(OfflineContentAggregatorTest, ActionPropagatesImmediately) { … }
TEST_F(OfflineContentAggregatorTest, OnItemsAddedPropagatedToObservers) { … }
TEST_F(OfflineContentAggregatorTest, OnItemRemovedPropagatedToObservers) { … }
TEST_F(OfflineContentAggregatorTest, OnItemUpdatedPropagatedToObservers) { … }
TEST_F(OfflineContentAggregatorTest, ProviderRemovedDuringCallbackFlush) { … }
TEST_F(OfflineContentAggregatorTest, SameProviderWithMultipleNamespaces) { … }
TEST_F(OfflineContentAggregatorTest,
ItemRemovedWhileWaitingForItemsFromOtherProviders) { … }
TEST_F(OfflineContentAggregatorTest,
ItemUpdatedWhileWaitingForItemsFromOtherProviders) { … }
}
}