Skip to content
Permalink
Browse files
Support waiting for event in custom element
https://bugs.webkit.org/show_bug.cgi?id=241812

Patch by Youssef Soliman <youssefdevelops@gmail.com> on 2022-06-21
Reviewed by Eric Carlson.

Some media related layout tests require event listeners on custom HTML elements.

* LayoutTests/media/video-test.js:
(waitForEventAndFailFor):
(waitForEventAndTest):
(waitForEventAndTestFor):

Canonical link: https://commits.webkit.org/251718@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youssefsoli authored and webkit-commit-queue committed Jun 22, 2022
1 parent a62eb94 commit d1a65d4035a4f5f47d7cd1b322040f2b3c80b71d
Showing 1 changed file with 11 additions and 1 deletion.
@@ -283,7 +283,17 @@ function waitForEventAndFail(eventName)
waitForEventAndTest(eventName, "false", true);
}

function waitForEventAndFailFor(element, eventName)
{
waitForEventAndTest(element, eventName, "false", true);
}

function waitForEventAndTest(eventName, testFuncString, endit)
{
waitForEventAndTestFor(mediaElement, eventName, testFuncString, endit)
}

function waitForEventAndTestFor(element, eventName, testFuncString, endit)
{
function _eventCallback(event)
{
@@ -292,7 +302,7 @@ function waitForEventAndTest(eventName, testFuncString, endit)
endTest();
}

mediaElement.addEventListener(eventName, _eventCallback, true);
element.addEventListener(eventName, _eventCallback, true);
}

function waitForEventOnceOn(element, eventName, func, endit)

0 comments on commit d1a65d4

Please sign in to comment.