Commit b3a13798 authored by Lan Wei's avatar Lan Wei Committed by Chromium LUCI CQ

Simulate user inputs in css/selectors/focus-visible-004.html

Use testdriver Action API to simulate mouse click actions in
css/selectors/focus-visible-004.html.

Bug: 1145677
Change-Id: I3715e32893f0e977226412d8ffc8b6928ff7a1a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2551803Reviewed-by: default avatarMustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833520}
parent d6b988a8
......@@ -7,6 +7,9 @@
<link rel="help" href="https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<style>
:focus-visible {
outline: red dotted 1px; /* fallback for Edge */
......@@ -40,7 +43,7 @@
<button data-tested="false" id="el-4">Focus me</span>
</div>
<div>
<input data-tested="false" id="el-5" type="button" value="Focus me"</input>
<input data-tested="false" id="el-5" type="button" value="Focus me"></input>
</div>
<div>
<input data-tested="false" id="el-6" type="image" alt="Focus me."></input>
......@@ -71,6 +74,11 @@
<label><input data-tested="false" id="el-11" type="color"></input> Focus me.</label>
</div>
<script>
function mouseClickInTarget(selector) {
let target = document.querySelector(selector);
return test_driver.click(target);
}
async_test(function(t) {
document.querySelectorAll("[data-tested]").forEach((el) => {
el.addEventListener("click", t.step_func((e) => {
......@@ -84,6 +92,8 @@
}
}));
});
mouseClickInTarget("[data-tested=false]");
}, "Mouse focus on input elements which do not show a virtual keyboard should NOT match :focus-visible - not affected by -webkit-appearance");
</script>
</body>
......
importAutomationScript('/pointerevents/pointerevent_common_input.js');
function inject_input() {
return mouseClickInTarget("[data-tested=false]");
};
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