| <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> |