chromium/content/browser/webid/federated_auth_request_impl_registry_unittest.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <memory>
#include <ostream>
#include <string>
#include <utility>

#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "content/browser/webid/federated_auth_request_impl.h"
#include "content/browser/webid/test/delegated_idp_network_request_manager.h"
#include "content/browser/webid/test/mock_api_permission_delegate.h"
#include "content/browser/webid/test/mock_auto_reauthn_permission_delegate.h"
#include "content/browser/webid/test/mock_identity_registry.h"
#include "content/browser/webid/test/mock_identity_request_dialog_controller.h"
#include "content/browser/webid/test/mock_idp_network_request_manager.h"
#include "content/browser/webid/test/mock_modal_dialog_view_delegate.h"
#include "content/browser/webid/test/mock_permission_delegate.h"
#include "content/public/common/content_features.h"
#include "content/test/test_render_view_host.h"
#include "content/test/test_web_contents.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/webid/federated_auth_request.mojom.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"
#include "url/origin.h"

ApiPermissionStatus;
RegisterIdpStatus;
_;
NiceMock;
Return;
StrictMock;

namespace content {

namespace {

constexpr char kIdpUrl[] =;

class TestApiPermissionDelegate : public MockApiPermissionDelegate {};

}  // namespace

class FederatedAuthRequestImplRegistryTest
    : public RenderViewHostImplTestHarness {};

// Test Registering an IdP successfully.
TEST_F(FederatedAuthRequestImplRegistryTest, RegistersIdPSuccessfully) {}

// Test Registering denied without user activation.
TEST_F(FederatedAuthRequestImplRegistryTest,
       RegistersIdPDeniedWithoutUserActivation) {}

// Test Registering an IdP without the feature enabled.
TEST_F(FederatedAuthRequestImplRegistryTest, RegistersWithoutFeature) {}

// Test Registering a configURL of a different origin.
TEST_F(FederatedAuthRequestImplRegistryTest, RegistersCrossOriginNotAllowed) {}

// Test Unregistering an IdP without the feature enabled.
TEST_F(FederatedAuthRequestImplRegistryTest, UnregistersWithoutFeature) {}

// Test Unregistering an IdP with the feature enabled but for a different
// origin.
TEST_F(FederatedAuthRequestImplRegistryTest, UnregisterAcrossOrigin) {}

// Test Unregistering an IdP Successfully.
TEST_F(FederatedAuthRequestImplRegistryTest, UnregistersIdP) {}

}  // namespace content