#include <memory>
#include <string>
#include <vector>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/values_test_util.h"
#include "base/values.h"
#include "components/network_session_configurator/common/network_switches.h"
#include "content/browser/in_memory_federated_permission_context.h"
#include "content/browser/webid/fake_identity_request_dialog_controller.h"
#include "content/browser/webid/identity_registry.h"
#include "content/browser/webid/test/mock_digital_identity_provider.h"
#include "content/browser/webid/test/mock_identity_request_dialog_controller.h"
#include "content/browser/webid/test/mock_modal_dialog_view_delegate.h"
#include "content/browser/webid/test/webid_test_content_browser_client.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/identity_request_dialog_controller.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "net/base/features.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_status_code.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "services/network/public/cpp/cors/cors.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "url/gurl.h"
#include "url/origin.h"
EmbeddedTestServer;
HttpStatusCode;
BasicHttpResponse;
HttpMethod;
HttpRequest;
HttpResponse;
_;
Eq;
NiceMock;
WithArg;
WithArgs;
namespace content {
namespace {
constexpr char kRpHostName[] = …;
constexpr char kIdpOrigin[] = …;
constexpr char kExpectedConfigPath[] = …;
constexpr char kExpectedWellKnownPath[] = …;
constexpr char kTestContentType[] = …;
constexpr char kIdpForbiddenHeader[] = …;
static constexpr char kSetLoginHeader[] = …;
static constexpr char kLoggedInHeaderValue[] = …;
static constexpr char kLoggedOutHeaderValue[] = …;
constexpr char kToken[] = …;
constexpr char kJsErrorPrefix[] = …;
std::string ExtractJsError(const EvalJsResult& result) { … }
bool IsGetRequestWithPath(const HttpRequest& request,
const std::string& expected_path) { … }
class IdpTestServer { … };
class TestFederatedIdentityModalDialogViewDelegate
: public NiceMock<MockModalDialogViewDelegate> { … };
}
class WebIdBrowserTest : public ContentBrowserTest { … };
class WebIdIdpSigninStatusBrowserTest : public WebIdBrowserTest { … };
class WebIdIdpSigninStatusForFetchKeepAliveBrowserTest
: public WebIdBrowserTest { … };
class WebIdIdPRegistryBrowserTest : public WebIdBrowserTest { … };
class WebIdAuthzBrowserTest : public WebIdBrowserTest { … };
IN_PROC_BROWSER_TEST_F(WebIdBrowserTest, FullLoginFlow) { … }
IN_PROC_BROWSER_TEST_F(WebIdBrowserTest, AbsoluteURLs) { … }
IN_PROC_BROWSER_TEST_F(WebIdBrowserTest, FailsOnHTTP) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdPRegistryBrowserTest, RegisterIdP) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdPRegistryBrowserTest, RpCantRegisterIdP) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdPRegistryBrowserTest, UnregisterIdP) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdPRegistryBrowserTest, UseRegistry) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdPRegistryBrowserTest, RegistryWithTypeNoMatch) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdPRegistryBrowserTest, RegistryWithTypeMatch) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdPRegistryBrowserTest, MultipleRegisteredIdps) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdpSigninStatusBrowserTest, IdpSigninToplevel) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdpSigninStatusBrowserTest, IdpSignoutToplevel) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdpSigninStatusBrowserTest,
IdpSigninAndOutSubresource) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdpSigninStatusForFetchKeepAliveBrowserTest,
IdpSigninAndOutSubresourceFetchKeepAliveInBrowser) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdpSigninStatusBrowserTest,
IdpSigninAndOutSyncXhr) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdpSigninStatusBrowserTest,
IdpSigninAndOutFetchFromWorker) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdpSigninStatusBrowserTest,
IdpSigninAndOutFetchFromNestedWorker) { … }
IN_PROC_BROWSER_TEST_F(WebIdIdpSigninStatusBrowserTest, IdPClose) { … }
class WebIdDigitalCredentialsBrowserTest : public WebIdBrowserTest { … };
std::string BuildDigitalIdentityValidJsRequestDictionary() { … }
EvalJsResult EvalJsAndReturnToken(const ToRenderFrameHost& execution_target,
std::string_view script_setting_token) { … }
EvalJsResult RunDigitalIdentityValidRequest(
const ToRenderFrameHost& execution_target) { … }
MATCHER_P(JsonMatches, ref, "") { … }
IN_PROC_BROWSER_TEST_F(WebIdDigitalCredentialsBrowserTest,
NavigatorIdentityApi) { … }
IN_PROC_BROWSER_TEST_F(WebIdDigitalCredentialsBrowserTest,
OnlyOneInFlightDigitalCredentialRequestIsAllowed) { … }
IN_PROC_BROWSER_TEST_F(WebIdDigitalCredentialsBrowserTest,
UserDeclinesRequest) { … }
IN_PROC_BROWSER_TEST_F(WebIdDigitalCredentialsBrowserTest,
RecordRequestStatusHistogramAfterRequestCompletes) { … }
IN_PROC_BROWSER_TEST_F(WebIdAuthzBrowserTest, Authz_noPopUpWindow) { … }
IN_PROC_BROWSER_TEST_F(WebIdAuthzBrowserTest, Authz_invalidFields) { … }
IN_PROC_BROWSER_TEST_F(WebIdAuthzBrowserTest, Authz_openPopUpWindow) { … }
IN_PROC_BROWSER_TEST_F(WebIdBrowserTest, IdentityCredentialError) { … }
IN_PROC_BROWSER_TEST_F(WebIdBrowserTest,
IdpHas3PCAccessAndAddsRPInApprovedClients) { … }
IN_PROC_BROWSER_TEST_F(WebIdBrowserTest,
MediationInIdentityCredentialRequestOptions) { … }
IN_PROC_BROWSER_TEST_F(WebIdBrowserTest,
NoConsoleWarningWithProperMediationCall) { … }
}