#include "chrome/browser/webid/federated_identity_account_keyed_permission_context.h"
#include <memory>
#include "base/functional/callback_helpers.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "chrome/test/base/testing_profile.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_task_environment.h"
#include "net/base/schemeful_site.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features_generated.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace {
constexpr char kTestIdpOriginKey[] = …;
ElementsAre;
IsEmpty;
}
class FederatedIdentityAccountKeyedPermissionContextTest
: public testing::Test { … };
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest,
VerifyKeyRequesterAndEmbedderIdentical) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest, VerifyKeySeparator) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest,
CompatibleWithOldFormat) { … }
namespace {
struct PermissionGrant { … };
}
void TestGrantAndRevoke(FederatedIdentityAccountKeyedPermissionContext* context,
const PermissionGrant& grant1,
const PermissionGrant& grant2) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest, GrantAndRevoke) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest,
GrantPermissionForSameAccount) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest, RecoverFrom1381130) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest,
HasPermission_SchemefulSite) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest, RevokeNoMatch) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest,
GetSharingPermissionGrantsAsContentSettings_FeatureDisabled) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest,
GetSharingPermissionGrantsAsContentSettings_FeatureEnabled) { … }
TEST_F(FederatedIdentityAccountKeyedPermissionContextTest,
PermissionWithAndWithoutTimestamp) { … }