#include "components/optimization_guide/core/model_execution/substitution.h"
#include <cstdint>
#include <initializer_list>
#include "base/logging.h"
#include "base/test/test.pb.h"
#include "components/optimization_guide/core/model_execution/on_device_model_execution_proto_descriptors.h"
#include "components/optimization_guide/core/model_execution/test/feature_config_builder.h"
#include "components/optimization_guide/proto/descriptors.pb.h"
#include "components/optimization_guide/proto/features/compose.pb.h"
#include "components/optimization_guide/proto/features/tab_organization.pb.h"
#include "components/optimization_guide/proto/substitution.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace optimization_guide {
namespace {
class SubstitutionTest : public testing::Test { … };
auto PageTitleField() { … }
auto ToneField() { … }
auto LengthField() { … }
auto TabsField() { … }
auto TabId() { … }
auto TabTitle() { … }
auto Condition(proto::ProtoField&& p,
proto::OperatorType op,
proto::Value&& val) { … }
auto ConditionList(proto::ConditionEvaluationType t,
std::initializer_list<proto::Condition> conds) { … }
auto ConditionCheckExpr(const std::string& cond_name,
proto::ConditionList&& cond_list) { … }
TEST_F(SubstitutionTest, RawString) { … }
TEST_F(SubstitutionTest, BadTemplate) { … }
TEST_F(SubstitutionTest, ProtoField) { … }
TEST_F(SubstitutionTest, BadProtoField) { … }
TEST_F(SubstitutionTest, Conditions) { … }
proto::TabOrganizationRequest TwoTabRequest() { … }
proto::SubstitutedString TabsExpr(const proto::StringSubstitution& expr) { … }
TEST_F(SubstitutionTest, RepeatedRawField) { … }
TEST_F(SubstitutionTest, RepeatedProtoField) { … }
TEST_F(SubstitutionTest, RepeatedZeroBasedIndexField) { … }
TEST_F(SubstitutionTest, RepeatedOneBasedIndexField) { … }
TEST_F(SubstitutionTest, RepeatedCondition) { … }
}
}