Commit 91422196 authored by danakj's avatar danakj Committed by Commit Bot

De-flake webaudio-autoplay-iframe-with-gesture due to compositing race

chrome.gpuBenchmarking.pointerActionSequence() has synchronization
problems, as the hit testing is done against compositor submissions
but the gpuBenchmarking methods do not cause or wait for compositing
to occur. So tests must explicitly do this themselves to avoid flaky
behaviour.

The webaudio-autoplay-iframe-with-gesture.html test on its own works
fine, somehow. But the compositing of the iframe fails to beat the
gpuBenchmarking synthetic events if it runs after the
document-user-activation-cross-origin-feature-policy-header.html
test which also involves gpuBenchmarking synthetic events.

This adds waits in the test's js code to make up for the
gpuBenchmarking harness being flaky.

R=yigu@chromium.org

Bug: 872952, 1091299
Change-Id: I6c4cb1ffc51286584ef9c7079bfff8677da1e1a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2230768
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: default avatarYi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775195}
parent 65ccabd6
...@@ -98,7 +98,6 @@ crbug.com/1050826 external/wpt/mixed-content/gen/top.http-rp/opt-in/object-tag.h ...@@ -98,7 +98,6 @@ crbug.com/1050826 external/wpt/mixed-content/gen/top.http-rp/opt-in/object-tag.h
# Tests temporarily disabled with Site Isolation - uninvestigated bugs: # Tests temporarily disabled with Site Isolation - uninvestigated bugs:
# TODO(lukasza, alexmos): Burn down this list. # TODO(lukasza, alexmos): Burn down this list.
crbug.com/872952 http/tests/media/autoplay/webaudio-autoplay-iframe-with-gesture.html [ Timeout Pass ]
crbug.com/949003 http/tests/printing/cross-site-frame-scrolled.html [ Pass Failure ] crbug.com/949003 http/tests/printing/cross-site-frame-scrolled.html [ Pass Failure ]
crbug.com/949003 http/tests/printing/cross-site-frame.html [ Pass Failure ] crbug.com/949003 http/tests/printing/cross-site-frame.html [ Pass Failure ]
# ====== Site Isolation failures until here ====== # ====== Site Isolation failures until here ======
......
...@@ -17,20 +17,4 @@ document.body.addEventListener('click', () => { ...@@ -17,20 +17,4 @@ document.body.addEventListener('click', () => {
top.postMessage(result, '*'); top.postMessage(result, '*');
}, { once: true }); }, { once: true });
const elementBoundingRect = document.body.getBoundingClientRect();
const xPos = elementBoundingRect.left + elementBoundingRect.width / 2;
const yPos = elementBoundingRect.top + elementBoundingRect.height / 2;
const leftButton = 0;
chrome.gpuBenchmarking.pointerActionSequence([
{
source: 'mouse',
actions: [
{ name: 'pointerMove', x: xPos, y: yPos },
{ name: 'pointerDown', x: xPos, y: yPos, button: leftButton },
{ name: 'pointerUp' }
]
}
]);
</script> </script>
...@@ -13,7 +13,33 @@ async_test(t => { ...@@ -13,7 +13,33 @@ async_test(t => {
assert_equals(e.data, 'running'); assert_equals(e.data, 'running');
}), { once: true }); }), { once: true });
const frame = document.getElementsByTagName('iframe')[0];
// Navigate the iframe to a cross origin site. // Navigate the iframe to a cross origin site.
document.getElementsByTagName('iframe')[0].src = 'http://localhost:8000/media/autoplay/resources/webaudio-iframe-with-gesture.html'; frame.src = 'http://localhost:8000/media/autoplay/resources/webaudio-iframe-with-gesture.html';
const frameRect = frame.getBoundingClientRect();
const xPos = frameRect.left + frameRect.width / 2;
const yPos = frameRect.top + frameRect.height / 2;
const leftButton = 0;
// TODO(crbug.com/1091299): gpuBenchmarking should deal with this
// synchronization.
// Wait for the iframe to load, then wait for a composite to happen before
// we dispatch an event. If we don't wait for these, the test is flaky and
// will fail if the pointerActionSequence() beats the compositor hit test
// data to the browser. See also https://crbug.com/872952 for analysis.
frame.onload = () =>
testRunner.updateAllLifecyclePhasesAndCompositeThen(()=>
chrome.gpuBenchmarking.pointerActionSequence([
{
source: 'mouse',
actions: [
{ name: 'pointerMove', x: xPos, y: yPos },
{ name: 'pointerDown', x: xPos, y: yPos, button: leftButton },
{ name: 'pointerUp' }
]
}
]));
}); });
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment