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

Simulate user inputs in focus-visible tests in css/selectors/

Use testdriver Action API to simulate mouse actions in
css/selectors/focus-visible-006.html and
css/selectors/focus-visible-008.html.

Bug: 1145677
Change-Id: Id25c6120f1dbd489d4c803ee979e67ad5ef49f8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2551818Reviewed-by: default avatarMustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#838271}
parent 183c2246
......@@ -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>
span[contenteditable] {
border: 1px solid black;
......@@ -42,6 +45,8 @@
assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 100, 0)");
t.done();
}));
test_driver.click(el);
}, "Focus should always match :focus-visible on content editable divs");
</script>
</body>
......
......@@ -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: darkgreen auto 5px;
......@@ -44,6 +47,12 @@
el.focus();
});
}
const tab_key = '\ue004';
const enter_key = '\uE007';
test_driver.send_keys(el, tab_key).then(() => {
test_driver.send_keys(el, enter_key);
});
</script>
</body>
</html>
importAutomationScript('/pointerevents/pointerevent_common_input.js');
function inject_input() {
return mouseClickInTarget("#el");
};
importAutomationScript('/input-events/inputevent_common_input.js');
function inject_input() {
return keyDown("Tab").then(() => {
return keyDown("Enter");
});
};
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