#include "third_party/blink/renderer/core/html/media/media_video_visibility_tracker.h"
#include "base/test/mock_callback.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.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/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
namespace blink {
_;
Return;
UnorderedElementsAreArray;
namespace {
class RequestVisibilityCallback { … };
}
class MediaVideoVisibilityTrackerTest : public SimTest { … };
#if DCHECK_IS_ON()
TEST_F(MediaVideoVisibilityTrackerTest, InvalidThreshold) { … }
#endif
TEST_F(MediaVideoVisibilityTrackerTest,
NoOcclusionDoesNotMeetVisibilityThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest, NoOcclusionMeetsVisibilityThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest, VideoControlsAreIgnored) { … }
TEST_F(MediaVideoVisibilityTrackerTest, NoViewPortIntersection) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
SingleElementNotOccludingAboveThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest, SingleElementOccludingAboveThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
MultipleElementsOccludingEqualToThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
MultipleElementsOccludingGreaterThanThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest, ElementWithZeroOpacityIsIgnored) { … }
TEST_F(MediaVideoVisibilityTrackerTest, ElementsBehindVideoAreIgnored) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
MultipleIntersectingElementsOccludingGreaterThanThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
MultipleIntersectingElementsOccludingBelowThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
HitTestingStopsWhenOcclusionAboveThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ViewportIntersectionFromVisibleToNotVisibleWithNoOcclusion) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ViewportIntersectionFromNotVisibleToVisibleWithNoOcclusion) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
SingleElementPartiallyIntersectingNotOccludingAboveThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
NonUserAgentShadowDomElementOccludingAboveThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ElementAddedAfterPlayOccludingAboveThreshold) { … }
TEST_F(MediaVideoVisibilityTrackerTest, ClientIdsSetContents) { … }
TEST_F(MediaVideoVisibilityTrackerTest, ClientIdsSetEndIndexEqualToStartIndex) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ClientIdsSetBeginIndexGreaterThanEndIndex) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ComputeVisibilityOnDemandReportsFalseWhenTrackerNotAttached) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ComputeVisibilityOnDemandReportsTrueWhenVideoMeetsVisibility) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ComputeVisibilityOnDemandReportsFalseWhenVideoDoesNotMeetVisibility) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ComputeVisibilityOnDemandHitTestTimerIgnored) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ComputeVisibilityOnDemandNewCallbacksTakePriority) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ComputeVisibilityOnDemandUsesCachedVisibilityValue) { … }
TEST_F(MediaVideoVisibilityTrackerTest,
ComputeVisibilityOnDemandReportsFalseIfTrackerDetached) { … }
}