#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/page_content_annotations/core/page_content_annotations_service.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/gmock_move_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/history/core/browser/history_service.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/optimization_guide/core/test_optimization_guide_decider.h"
#include "components/optimization_guide/core/test_optimization_guide_model_provider.h"
#include "components/page_content_annotations/core/page_content_annotations_features.h"
#include "components/page_content_annotations/core/test_page_content_annotator.h"
#include "components/search_engines/search_engines_test_environment.h"
#include "components/search_engines/template_url_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace page_content_annotations {
namespace {
_;
const TemplateURLService::Initializer kTemplateURLData[] = …;
class MockHistoryService : public history::HistoryService { … };
class FakeOptimizationGuideDecider
: public optimization_guide::TestOptimizationGuideDecider { … };
}
class PageContentAnnotationsServiceTest : public testing::Test { … };
TEST_F(PageContentAnnotationsServiceTest, ObserveLocalVisitNonSearch) { … }
TEST_F(PageContentAnnotationsServiceTest, NonHTTPUrlIgnored) { … }
TEST_F(PageContentAnnotationsServiceTest, ObserveSyncedVisitsNonSearch) { … }
TEST_F(PageContentAnnotationsServiceTest, ObserveLocalVisitsSearch) { … }
TEST_F(PageContentAnnotationsServiceTest, ObserveSyncedVisitsSearch) { … }
TEST_F(PageContentAnnotationsServiceTest, BatchLimitTriggersJob) { … }
TEST_F(PageContentAnnotationsServiceTest, BatchSizeTimeout) { … }
TEST_F(PageContentAnnotationsServiceTest, OlderVisitsDropped) { … }
class PageContentAnnotationsServiceRemotePageMetadataTest
: public PageContentAnnotationsServiceTest { … };
TEST_F(PageContentAnnotationsServiceRemotePageMetadataTest,
RegistersTypeWhenFeatureEnabled) { … }
TEST_F(PageContentAnnotationsServiceRemotePageMetadataTest,
DoesNotPersistIfServerHasNoData) { … }
TEST_F(PageContentAnnotationsServiceRemotePageMetadataTest,
DoesNotPersistIfServerReturnsWrongMetadata) { … }
TEST_F(PageContentAnnotationsServiceRemotePageMetadataTest,
RequestsToPersistIfHasPageMetadata) { … }
class PageContentAnnotationsServiceSalientImageMetadataTest
: public PageContentAnnotationsServiceTest { … };
TEST_F(PageContentAnnotationsServiceSalientImageMetadataTest,
RegistersTypeWhenFeatureEnabled) { … }
TEST_F(PageContentAnnotationsServiceSalientImageMetadataTest,
DoesNotPersistIfServerHasNoData) { … }
TEST_F(PageContentAnnotationsServiceSalientImageMetadataTest,
DoesNotPersistIfServerReturnsWrongMetadata) { … }
TEST_F(PageContentAnnotationsServiceSalientImageMetadataTest,
RequestsToPersistIfHasSalientImageMetadata) { … }
}