#include "content/browser/browsing_topics/header_util.h"
#include "base/strings/strcat.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "content/test/test_render_view_host.h"
#include "services/network/public/mojom/parsed_headers.mojom.h"
namespace content {
namespace {
blink::mojom::EpochTopicPtr CreateMojomTopic(int topic,
const std::string& model_version) { … }
class TopicsInterceptingContentBrowserClient : public ContentBrowserClient { … };
}
class BrowsingTopicsUtilTest : public RenderViewHostTestHarness { … };
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_EmptyTopics_ZeroVersionInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_EmptyTopics_OneVersionInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_EmptyTopics_TwoVersionsInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_EmptyTopics_ThreeVersionsInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_OneTopic_OneVersionInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_OneTopic_TwoVersionsInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_OneTopic_ThreeVersionsInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_OneThreeDigitTopic_OneVersionInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_TwoTopics_SameTopicVersions_OneVersionInEpochs) { … }
TEST_F(
BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_TwoMixedDigitsTopics_SameTopicVersions_OneVersionInEpochs) { … }
TEST_F(
BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_TwoTopics_SameTopicVersions_TwoVersionsInEpochs) { … }
TEST_F(
BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_TwoTopics_DifferentTopicVersions_TwoVersionsInEpochs) { … }
TEST_F(
BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_TwoTopics_DifferentTopicVersions_ThreeVersionsInEpochs) { … }
TEST_F(
BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_ThreeTopics_SameTopicVersions_OneVersionInEpochs) { … }
TEST_F(
BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_ThreeThreeDigitsTopics_SameTopicVersions_OneVersionInEpochs) { … }
TEST_F(
BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_ThreeThreeDigitsTopics_FirstTwoTopicVersionsSame_TwoVersionsInEpochs) { … }
TEST_F(
BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_ThreeThreeDigitsTopics_LastTwoTopicVersionsSame_TwoVersionsInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_ThreeThreeDigitsTopics_ThreeTopicVersions) { … }
TEST_F(
BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_InconsistentNumTopicsVersionsAndNumVersionsInEpochs) { … }
TEST_F(BrowsingTopicsUtilTest,
DeriveTopicsHeaderValue_LengthExceedsDefaultMax_NoPadding) { … }
TEST_F(BrowsingTopicsUtilTest,
HandleTopicsEligibleResponse_TrueValueObserveTopicsHeader) { … }
TEST_F(BrowsingTopicsUtilTest,
HandleTopicsEligibleResponse_FalseValueObserveTopicsHeader) { … }
TEST_F(BrowsingTopicsUtilTest, HandleTopicsEligibleResponse_InactiveFrame) { … }
}