blob: 3bb8bec6be4d0ae7390ef52aad2738bf69e6ba8d [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scheduler.js" type="text/javascript"></script>
<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
<script type="text/javascript">
description("This test checks that calling `scheduleLayout()` multiple times with the same function yields a single call to that function.");
window.jsTestIsAsync = true;
if (window.testRunner)
window.testRunner.dumpAsText();
let numberOfCalls = 0;
function layout()
{
numberOfCalls++;
}
scheduler.frameDidFire = function()
{
shouldBe("numberOfCalls", "1");
finishMediaControlsTest();
};
scheduler.scheduleLayout(layout);
scheduler.scheduleLayout(layout);
scheduler.scheduleLayout(layout);
</script>
<script src="../../../resources/js-test-post.js"></script>