chromium/components/feed/core/v2/proto_util_unittest.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// kFeedBottomSyncStringRemoval is mobile-only.
#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,
          /*request_metadata=*/{},
          /*consistency_token=*/std::string(), SingleWebFeedEntryPoint::kOther,
          /*doc_view_counts=*/{})
          .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) {}

// ReadLater is enabled by default everywhere with the exception of iOS which
// has a build-flag to enable it.
#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) {}

}  // namespace
}  // namespace feed