Skip to content

Commit

Permalink
[selectors] Fix leaks on focus-visible-{007,013}.html tests
Browse files Browse the repository at this point in the history
These tests are using test_driver.click() which has a known issue,
see bug #1164600. This is a similar fix to r841432 that fixed leaks
in other :focus-visible tests.

Bug: 976438
Change-Id: I3a17fcccf8d8c01f2259b965f63df3d4ff521bad
Cq-Include-Trybots: luci.chromium.try:layout_test_leak_detection,leak_detection_linux
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2648468
Reviewed-by: Javier Fernandez <jfernandez@igalia.com>
Commit-Queue: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#847122}
  • Loading branch information
mrego authored and chromium-wpt-export-bot committed Jan 26, 2021
1 parent 3fdce5e commit 97e2f32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion css/selectors/focus-visible-007.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

<div id="one" tabindex="0">Click me.</div>
<script>
setup({ explicit_done: true });

document.body.addEventListener("keydown", (e) => {
delete document.body.dataset.hadmousedown;
document.body.dataset.hadkeydown = "";
Expand Down Expand Up @@ -75,7 +77,7 @@
});

one.addEventListener("focus", handle_initial_focus);
test_driver.click(one);
test_driver.click(one).then(() => done());
}, "Using keyboard while element is focused should trigger :focus-visible; using mouse without moving focus should not cancel it; moving focus using mouse should cancel it.");
</script>
</body>
Expand Down
4 changes: 3 additions & 1 deletion css/selectors/focus-visible-013.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@
<div id="target" tabindex="0">Target</div>

<script>
setup({ explicit_done: true });

async_test(function(t) {
initial.addEventListener("focus", t.step_func(function() {
assert_equals(getComputedStyle(initial).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${initial.tagName}#${initial.id} should be green`);
test_driver.click(target);
test_driver.click(target).then(() => done());
}));

target.addEventListener("focus", t.step_func_done(function() {
Expand Down

0 comments on commit 97e2f32

Please sign in to comment.