Commit 1a1b341f authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

Add a test for floats in a-tag reacts to clicks

This was regressed but then fixed before the regression was
reported. This patch adds a test to avoid future regressions.

Bug: 1022641
Change-Id: I8bcda25fdcfcb2ed87d517a06c0e46699d4bb4e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1956975Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723015}
parent f13829ad
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<style>
img {
float: left;
width: 400px;
height: 200px;
background: orange;
}
#scroll {
clear: both;
height: 200vh;
}
</style>
<div>
<span>
<a href="#scroll">
<img id="click" src="">
</a>
&nbsp;
</span>
</div>
<div id="scroll"></div>
<script>
if (window.chrome && chrome.gpuBenchmarking) {
let t = async_test('Test floating objects in a-tag.');
runTest((x, y) => {
chrome.gpuBenchmarking.pointerActionSequence([
{"source": "mouse",
"actions":[
{"name": "pointerMove", "x": x, "y": y},
{"name": "pointerDown", "x": x, "y": y},
{"name": "pointerUp"}]}],
() => {
t.step(checkTestResult);
t.done();
});
})
}
function runTest(click_func) {
let click = document.getElementById('click');
let bounds = click.getBoundingClientRect();
let x = (bounds.x + bounds.width) / 2;
let y = (bounds.y + bounds.height) / 2;
click_func(x, y);
}
function checkTestResult() {
let scroll = document.getElementById('scroll');
assert_equals(document.documentElement.scrollTop, scroll.offsetTop);
}
</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