Bug 1541519 [wpt PR 16047] - [shadow-dom] Fix flakiness of untriaged/html-elements-in-shadow-trees/html-forms/test-003.html, a=testonly

Automatic update from web-platform-tests
[shadow-dom] Fix flakiness of untriaged/html-elements-in-shadow-trees/html-forms/test-003.html

The test assumed to finish a form submission in 2 seconds. It's the
source of the flakiness. We should listen 'load' event of the target
iframe.

Bug: crbug.com/941565
Change-Id: I2010d1ade5240acd99030751b595ee711c71c74e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1535685
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#643751}

--

wpt-commits: 95dc0badd6ab33d9706372bce73c6751ce52fad1
wpt-pr: 16047
This commit is contained in:
Kent Tamura 2019-04-18 11:17:19 +00:00 коммит произвёл James Graham
Родитель 1843763c7a
Коммит c22a99f5d9
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -51,7 +51,6 @@ A_08_02_03_T01.step(function () {
iframe.src = '../../resources/blank.html';
iframe.setAttribute('name', 'targetIframe');
d.body.appendChild(iframe);
// create form
var form = d.createElement('form');
@ -77,11 +76,13 @@ A_08_02_03_T01.step(function () {
input2.setAttribute('value', 'value2');
s.appendChild(input2);
// submit the form
form.submit();
// set timeout to give the iframe time to load content
setTimeout(checkIframeContent, 2000);
// Wait for the first 'load' event for blank.html.
iframe.onload = A_08_02_03_T01.step_func(() => {
// Wait for the second 'load' event for the submission.
iframe.onload = checkIframeContent;
form.submit();
});
d.body.appendChild(iframe);
});
</script>
</body>