#include "components/embedder_support/origin_trials/origin_trial_policy_impl.h"
#include <memory>
#include <vector>
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "base/test/scoped_feature_list.h"
#include "components/embedder_support/origin_trials/features.h"
#include "components/embedder_support/switches.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/origin_trials/origin_trials_settings_provider.h"
#include "third_party/blink/public/mojom/origin_trials/origin_trials_settings.mojom.h"
namespace embedder_support {
const blink::OriginTrialPublicKey kTestPublicKey1 = …;
const blink::OriginTrialPublicKey kTestPublicKey2 = …;
const char kTestPublicKeyString[] = …;
const char kTwoTestPublicKeysString[] = …;
const char kBadEncodingPublicKeyString[] = …;
const char kTooShortPublicKeyString[] = …;
const char kTooLongPublicKeyString[] = …;
const char kTwoPublicKeysString_BadAndGood[] = …;
const char kTwoBadPublicKeysString[] = …;
const char kOneDisabledFeature[] = …;
const char kTwoDisabledFeatures[] = …;
const char kThreeDisabledFeatures[] = …;
const char kSpacesInDisabledFeatures[] = …;
const uint8_t kToken1Signature[] = …;
const char kToken1SignatureEncoded[] = …;
const uint8_t kToken2Signature[] = …;
const char kToken2SignatureEncoded[] = …;
const uint8_t kToken3Signature[] = …;
const char kToken3SignatureEncoded[] = …;
class OriginTrialPolicyImplTest : public testing::Test { … };
TEST_F(OriginTrialPolicyImplTest, DefaultConstructor) { … }
TEST_F(OriginTrialPolicyImplTest, DefaultKeysAreConsistent) { … }
TEST_F(OriginTrialPolicyImplTest, OverridePublicKeys) { … }
TEST_F(OriginTrialPolicyImplTest, OverridePublicKeysWithTwoKeys) { … }
TEST_F(OriginTrialPolicyImplTest, OverrideKeysNotBase64) { … }
TEST_F(OriginTrialPolicyImplTest, OverrideKeysTooShort) { … }
TEST_F(OriginTrialPolicyImplTest, OverrideKeysTooLong) { … }
TEST_F(OriginTrialPolicyImplTest, OverridePublicKeysWithBadAndGoodKey) { … }
TEST_F(OriginTrialPolicyImplTest, OverridePublicKeysWithTwoBadKeys) { … }
TEST_F(OriginTrialPolicyImplTest, NoDisabledFeatures) { … }
TEST_F(OriginTrialPolicyImplTest, DisableOneFeature) { … }
TEST_F(OriginTrialPolicyImplTest, DisableTwoFeatures) { … }
TEST_F(OriginTrialPolicyImplTest, DisableThreeFeatures) { … }
TEST_F(OriginTrialPolicyImplTest, DisableFeatureWithSpace) { … }
TEST_F(OriginTrialPolicyImplTest, NoDisabledTokens) { … }
TEST_F(OriginTrialPolicyImplTest, DisableOneToken) { … }
TEST_F(OriginTrialPolicyImplTest, DisableTwoTokens) { … }
TEST_F(OriginTrialPolicyImplTest, DisableThreeTokens) { … }
TEST_F(OriginTrialPolicyImplTest, AllNonDeprecationTrialsAreDisabledByFlag) { … }
TEST_F(OriginTrialPolicyImplTest, DisableFeatureForUser) { … }
TEST_F(OriginTrialPolicyImplTest, DisableFeatureForUserAfterCheck) { … }
class OriginTrialPolicyImplInitializationTest
: public OriginTrialPolicyImplTest { … };
TEST_F(OriginTrialPolicyImplInitializationTest, PublicKeyInitialized) { … }
TEST_F(OriginTrialPolicyImplInitializationTest, DisabledFeaturesInitialized) { … }
TEST_F(OriginTrialPolicyImplInitializationTest, DisabledTokensInitialized) { … }
}