#include "third_party/blink/renderer/core/html/html_permission_element.h"
#include "base/run_loop.h"
#include "base/test/run_until.h"
#include "base/test/scoped_feature_list.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/strings/grit/blink_strings.h"
#include "third_party/blink/renderer/core/css/css_property_names.h"
#include "third_party/blink/renderer/core/css/properties/css_property.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/document_init.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/geometry/dom_rect.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/html/html_span_element.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/script/classic_script.h"
#include "third_party/blink/renderer/core/testing/null_execution_context.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support.h"
namespace blink {
EmbeddedPermissionControlResult;
EmbeddedPermissionRequestDescriptor;
EmbeddedPermissionRequestDescriptorPtr;
PermissionDescriptor;
PermissionDescriptorPtr;
PermissionName;
PermissionObserver;
PermissionService;
MojoPermissionStatus;
namespace {
constexpr char kCameraString[] = …;
constexpr char kCameraAllowedString[] = …;
constexpr char kMicrophoneString[] = …;
constexpr char kMicrophoneAllowedString[] = …;
constexpr char kGeolocationString[] = …;
constexpr char kGeolocationAllowedString[] = …;
constexpr char kCameraMicrophoneString[] = …;
constexpr char kCameraMicrophoneAllowedString[] = …;
constexpr base::TimeDelta kDefaultTimeout = …;
constexpr base::TimeDelta kSmallTimeout = …;
class LocalePlatformSupport : public TestingPlatformSupport { … };
void NotReachedForPEPCRegistered() { … }
}
class HTMLPemissionElementTestBase : public PageTestBase { … };
TEST_F(HTMLPemissionElementTestBase, SetTypeAttribute) { … }
TEST_F(HTMLPemissionElementTestBase, ParsePermissionDescriptorsFromType) { … }
class PermissionStatusChangeWaiter : public PermissionObserver { … };
class TestPermissionService : public PermissionService { … };
class RegistrationWaiter { … };
class HTMLPemissionElementTest : public HTMLPemissionElementTestBase { … };
class DeferredChecker { … };
TEST_F(HTMLPemissionElementTest, InitializeInnerText) { … }
TEST_F(HTMLPemissionElementTest, AfterDetachLayoutTreeCrashTest) { … }
TEST_F(HTMLPemissionElementTest, SetInnerTextAfterRegistrationSingleElement) { … }
TEST_F(HTMLPemissionElementTest,
SetInnerTextAfterRegistrationCameraMicrophonePermissions) { … }
TEST_F(HTMLPemissionElementTest, StatusChangeSinglePermissionElement) { … }
TEST_F(HTMLPemissionElementTest,
StatusesChangeCameraMicrophonePermissionsElement) { … }
class HTMLPemissionElementClickingEnabledTest
: public HTMLPemissionElementTest { … };
TEST_F(HTMLPemissionElementClickingEnabledTest, UnclickableBeforeRegistered) { … }
class HTMLPemissionElementSimTest : public SimTest { … };
TEST_F(HTMLPemissionElementSimTest, BlockedByPermissionsPolicy) { … }
TEST_F(HTMLPemissionElementSimTest, EnableClickingAfterDelay) { … }
TEST_F(HTMLPemissionElementSimTest, BadContrastDisablesElement) { … }
TEST_F(HTMLPemissionElementSimTest, FontSizeCanDisableElement) { … }
class HTMLPemissionElementDispatchValidationEventTest
: public HTMLPemissionElementSimTest { … };
TEST_F(HTMLPemissionElementDispatchValidationEventTest, Registration) { … }
TEST_F(HTMLPemissionElementDispatchValidationEventTest, DisableEnableClicking) { … }
TEST_F(HTMLPemissionElementDispatchValidationEventTest,
ChangeReasonRestartTimer) { … }
TEST_F(HTMLPemissionElementDispatchValidationEventTest,
DisableEnableClickingDifferentReasons) { … }
class HTMLPemissionElementFencedFrameTest : public HTMLPemissionElementSimTest { … };
TEST_F(HTMLPemissionElementFencedFrameTest, NotAllowedInFencedFrame) { … }
TEST_F(HTMLPemissionElementSimTest, BlockedByMissingFrameAncestorsCSP) { … }
class HTMLPemissionElementIntersectionTest
: public HTMLPemissionElementSimTest { … };
TEST_F(HTMLPemissionElementIntersectionTest, IntersectionChanged) { … }
TEST_F(HTMLPemissionElementIntersectionTest,
IntersectionVisibleOverlapsRecentAttachedInterval) { … }
TEST_F(HTMLPemissionElementIntersectionTest,
IntersectionChangedDisableEnableDisable) { … }
TEST_F(HTMLPemissionElementIntersectionTest, ContainerDivRotates) { … }
TEST_F(HTMLPemissionElementIntersectionTest, ContainerDivOpacity) { … }
TEST_F(HTMLPemissionElementIntersectionTest, ContainerDivClipPath) { … }
class HTMLPemissionElementLayoutChangeTest
: public HTMLPemissionElementSimTest { … };
TEST_F(HTMLPemissionElementLayoutChangeTest, InvalidatePEPCAfterMove) { … }
TEST_F(HTMLPemissionElementLayoutChangeTest, InvalidatePEPCAfterResize) { … }
TEST_F(HTMLPemissionElementLayoutChangeTest, InvalidatePEPCAfterMoveContainer) { … }
TEST_F(HTMLPemissionElementLayoutChangeTest,
InvalidatePEPCAfterTransformContainer) { … }
TEST_F(HTMLPemissionElementLayoutChangeTest,
InvalidatePEPCLayoutInAnimationFrameCallback) { … }
}