#include "content/browser/webauth/webauth_request_security_checker.h"
#include <string_view>
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_web_contents_factory.h"
#include "device/fido/features.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/permissions_policy/permissions_policy.h"
#include "third_party/blink/public/mojom/webauthn/authenticator.mojom.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "url/url_util.h"
namespace content {
namespace {
blink::ParsedPermissionsPolicy CreatePolicyToAllowWebAuthn() { … }
blink::ParsedPermissionsPolicy CreatePolicyToDenyWebAuthn() { … }
blink::ParsedPermissionsPolicy CreatePolicyToAllowWebPayments() { … }
struct TestCase { … };
std::ostream& operator<<(std::ostream& out, const TestCase& test_case) { … }
class WebAuthRequestSecurityCheckerTest
: public testing::TestWithParam<TestCase> { … };
TEST_P(WebAuthRequestSecurityCheckerTest, ValidateAncestorOrigins) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
struct SingleFrameTestCase { … };
class WebAuthRequestSecurityCheckerSingleFrameTest
: public testing::TestWithParam<SingleFrameTestCase> { … };
TEST_P(WebAuthRequestSecurityCheckerSingleFrameTest,
ValidateAncestorOriginsOnRoot) { … }
INSTANTIATE_TEST_SUITE_P(…);
class WebAuthRequestSecurityCheckerWellKnownJSONTest : public testing::Test { … };
TEST_F(WebAuthRequestSecurityCheckerWellKnownJSONTest, Inputs) { … }
}
}