#include "content/browser/interest_group/interest_group_permissions_checker.h"
#include <string>
#include "base/containers/span.h"
#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "content/browser/interest_group/interest_group_permissions_cache.h"
#include "content/services/auction_worklet/worklet_test_util.h"
#include "net/base/network_isolation_key.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace content {
namespace {
constexpr base::TimeDelta kTinyTime = …;
const char kAllowAllResponse[] = …;
const char kAllowNoneResponse[] = …;
class BoolCallback { … };
class InterestGroupPermissionsCheckerTestBase { … };
class InterestGroupPermissionsCheckerTest
: public InterestGroupPermissionsCheckerTestBase,
public testing::Test { … };
class InterestGroupPermissionsCheckerParamaterizedTest
: public InterestGroupPermissionsCheckerTestBase,
public testing::TestWithParam<
InterestGroupPermissionsChecker::Operation> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, SameOrigin) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, RequestParameters) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, HttpError) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, WrongMimeType) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, ResponseBodyHandling) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, SameOperationsMerged) { … }
TEST_F(InterestGroupPermissionsCheckerTest, DifferentOperationsMerged) { … }
TEST_F(InterestGroupPermissionsCheckerTest,
DifferentOperationsMergedDifferentResults) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, DifferentFrameOrigin) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, DifferentOwner) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest,
DifferentNetworkIsolationKey) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, CacheExpires) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, NonDefaultPorts) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, HttpTimeout) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, MaxSize) { … }
TEST_P(InterestGroupPermissionsCheckerParamaterizedTest, MaxSizeExceeded) { … }
}
}