#include "components/feed/core/v2/proto_util.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "components/feed/core/proto/v2/wire/capability.pb.h"
#include "components/feed/core/proto/v2/wire/client_info.pb.h"
#include "components/feed/core/proto/v2/wire/feed_entry_point_source.pb.h"
#include "components/feed/core/proto/v2/wire/feed_request.pb.h"
#include "components/feed/core/proto/v2/wire/info_card.pb.h"
#include "components/feed/core/proto/v2/wire/request.pb.h"
#include "components/feed/core/v2/config.h"
#include "components/feed/core/v2/public/feed_api.h"
#include "components/feed/core/v2/test/proto_printer.h"
#include "components/feed/core/v2/test/test_util.h"
#include "components/feed/core/v2/types.h"
#include "components/feed/feed_feature_list.h"
#include "components/reading_list/features/reading_list_switches.h"
#include "components/version_info/channel.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace feed {
namespace {
InfoCardTrackingState;
Contains;
IsSupersetOf;
Not;
TEST(ProtoUtilTest, CreateClientInfo) { … }
TEST(ProtoUtilTest, DefaultCapabilities) { … }
TEST(ProtoUtilTest, HeartsEnabled) { … }
#if BUILDFLAG(IS_ANDROID)
TEST(ProtoUtilTest, SyncRestringEnabled) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitWithFeatures({kFeedBottomSyncStringRemoval}, {});
feedwire::FeedRequest request =
CreateFeedQueryRefreshRequest(
StreamType(StreamKind::kForYou), feedwire::FeedQuery::MANUAL_REFRESH,
{},
std::string(), SingleWebFeedEntryPoint::kOther,
{})
.feed_request();
ASSERT_THAT(request.client_capability(),
Contains(feedwire::Capability::SYNC_STRING_REMOVAL));
}
#endif
TEST(ProtoUtilTest, DisableCapabilitiesWithFinch) { … }
TEST(ProtoUtilTest, PrivacyNoticeCardAcknowledged) { … }
TEST(ProtoUtilTest, PrivacyNoticeCardNotAcknowledged) { … }
TEST(ProtoUtilTest, InfoCardTrackingStates) { … }
TEST(ProtoUtilTest, StampEnabled) { … }
TEST(ProtoUtilTest, DynamicColorEnabled) { … }
#if !BUILDFLAG(IS_IOS)
TEST(ProtoUtilTest, ReadLaterEnabled) { … }
#endif
TEST(ProtoUtilTest, CormorantEnabled) { … }
TEST(ProtoUtilTest, InfoCardAcknowledgementTrackingDisabled) { … }
TEST(ProtoUtilTest, FeedSignedOutViewDemotionEnablesCapability) { … }
TEST(ProtoUtilTest, TabGroupsEnabledForReplaced) { … }
TEST(ProtoUtilTest, TabGroupsEnabledForBoth) { … }
TEST(ProtoUtilTest, SignInStatusSetOnRequest) { … }
TEST(ProtoUtilTest, WithoutDocIds) { … }
TEST(ProtoUtilTest, WithDocIds) { … }
TEST(ProtoUtilTest, DefaultSearchEngineSetOnRequest) { … }
}
}