diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/semantics/popovers/popover-close-request.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/semantics/popovers/popover-close-request.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/popovers/popover-close-request.html | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-close-request.html b/testing/web-platform/tests/html/semantics/popovers/popover-close-request.html new file mode 100644 index 0000000000..830a40e060 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/popovers/popover-close-request.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Popover close request behavior</title> +<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> +<script src="/common/top-layer.js"></script> +<script src="/close-watcher/resources/helpers.js"></script> + +<div popover id=p1> + Inside popover 1 + <div popover id=p2>Inside popover 2</div> +</div> + +<script> +promise_test(async () => { + const popover1 = document.querySelector('#p1'); + const popover2 = document.querySelector('#p2'); + + popover1.showPopover(); + + // Bless the opening of popover2, so it doesn't get grouped with popover1 by + // the close watcher infrastructure. + await blessTopLayer(popover1); + popover2.showPopover(); + + assert_true(popover1.matches(':popover-open'), "Starting: popover1 must be open"); + assert_true(popover2.matches(':popover-open'), "Starting: popover2 must be open"); + + await sendCloseRequest(); + assert_true(popover1.matches(':popover-open'), "After one close request, popover1 must be open"); + assert_false(popover2.matches(':popover-open'), "After one close request, popover2 must be closed"); + + await sendCloseRequest(); + assert_false(popover1.matches(':popover-open'), "After two close requests, popover1 must be closed"); + assert_false(popover2.matches(':popover-open'), "After two close requests, popover2 must be closed"); +}); +</script> |