Files
sousa-gecko/testing/web-platform/tests/fenced-frame/document-activeelement.https.html
T
Liam Brady 0a0b19a264 Bug 1911608 [wpt PR 47462] - Fenced frame: attempt to deflake document activeElement test, a=testonly
Automatic update from web-platform-tests
Fenced frame: attempt to deflake document activeElement test

Like other similar flake fixes, this uses multiClick() to perform
multiple clicks in case one of the clicks doesn't properly register.

Bug: 353256758
Change-Id: Iad904730a8434c52d957353da2a940ad794ac88c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5762702
Commit-Queue: Liam Brady <lbrady@google.com>
Reviewed-by: Andrew Verge <averge@chromium.org>
Commit-Queue: Andrew Verge <averge@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1337300}

--

wpt-commits: 011dbf902aae67055f25a4513544e01ec6fa18d4
wpt-pr: 47462
2024-08-08 07:20:26 +00:00

38 lines
1.2 KiB
HTML

<!DOCTYPE html>
<title>Test document.activeElement</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="resources/utils.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<body>
<script>
promise_test(async(t) => {
const actions = new test_driver.Actions();
const fencedframe = await attachFencedFrameContext();
assert_equals(document.activeElement, document.body);
await multiClick(0, 0, fencedframe.element, 5);
assert_equals(document.activeElement, fencedframe.element);
}, 'document.activeElement should be the fenced frame when it has focus');
promise_test(async(t) => {
const actions = new test_driver.Actions();
const fencedframe = await attachFencedFrameContext();
await fencedframe.execute(() => {
assert_equals(document.activeElement, document.body);
})
}, "a fenced frame's document.activeElement should be its body when it " +
"doesn't have focus");
</script>
</body>