#include "content/browser/media/captured_surface_control_permission_manager.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/permission_request_description.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/test/mock_permission_controller.h"
#include "content/test/test_render_frame_host.h"
#include "content/test/test_web_contents.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h"
namespace content {
namespace {
PermissionStatus;
PermissionManager;
CallbackType;
CallbackActionType;
class CscMockPermissionController : public MockPermissionController { … };
class PermissionCheckState final { … };
class CapturedSurfaceControlPermissionManagerTest
: public RenderViewHostTestHarness,
public ::testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(CapturedSurfaceControlPermissionManagerTest,
UserNotPromptedOnFirstCheckAndHasNoTransientActivation) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest,
UserPromptedOnFirstCheckAndHasTransientActivation) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest,
DeniedReportedIfUserDeniesPrompt) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest,
GrantedReportedIfUserApprovesPrompt) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest,
AfterFirstGrantNoPromptAndNoActivationRequirement) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest, CanGrantAfterDenying) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest, EmbargoObserved) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest,
AdditionalPermissionChecksDeniedWhilePromptPending) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest,
SubsequentPermissionChecksAllowedAfterPromptAcceptedByUser) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest,
SubsequentPermissionChecksCauseNewPromptAfterPromptRejecdByUser) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest,
CallFailsIfCapturerUnfocused) { … }
TEST_P(CapturedSurfaceControlPermissionManagerTest,
UserPromptedIfCapturerFocused) { … }
}
}