blob: 0951e2c38e2998beef69940d565a582d1e624732 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<title>This tests the case when visible and actionable content shows up and gets destroyed right away.</title>
<script src="../../../../../resources/ui-helper.js"></script>
<style>
#tapThis {
width: 400px;
height: 400px;
border: 1px solid green;
}
#willBecomeVisibleMomentarily {
display: none;
width: 100px;
height: 100px;
background-color: green;
}
</style>
<script>
async function test() {
if (!window.testRunner || !testRunner.runUIScript)
return;
if (window.internals)
internals.settings.setContentChangeObserverEnabled(true);
testRunner.waitUntilDone();
testRunner.dumpAsText();
await UIHelper.activateElement(tapThis);
}
</script>
</head>
<body onload="test()">
<div id=tapThis>PASS if 'clicked' text is shown below.</div>
<div id=willBecomeVisibleMomentarily></div>
<pre id=result></pre>
<script>
tapThis.addEventListener("touchstart", function( event ) {
willBecomeVisibleMomentarily.style.display = "block";
}, false);
tapThis.addEventListener("mouseover", function( event ) {
willBecomeVisibleMomentarily.style.display = "none";
}, false);
willBecomeVisibleMomentarily.addEventListener("click", function( event ) {
result.innerHTML = "clicked willBecomeVisibleMomentarily";
}, false);
tapThis.addEventListener("click", function( event ) {
result.innerHTML = "clicked";
if (window.testRunner)
testRunner.notifyDone();
}, false);
</script>
</body>
</html>