diff options
Diffstat (limited to '')
-rw-r--r-- | toolkit/content/tests/browser/datetime/browser_datetime_toplevel.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/toolkit/content/tests/browser/datetime/browser_datetime_toplevel.js b/toolkit/content/tests/browser/datetime/browser_datetime_toplevel.js new file mode 100644 index 0000000000..2e97e4d2da --- /dev/null +++ b/toolkit/content/tests/browser/datetime/browser_datetime_toplevel.js @@ -0,0 +1,27 @@ +/* Any copyright is dedicated to the Public Domain. + * https://creativecommons.org/publicdomain/zero/1.0/ */ + +add_task(async function () { + let input = document.createElement("input"); + input.type = "date"; + registerCleanupFunction(() => input.remove()); + document.body.appendChild(input); + + let shown = BrowserTestUtils.waitForDateTimePickerPanelShown(window); + + const shadowRoot = SpecialPowers.wrap(input).openOrClosedShadowRoot; + + EventUtils.synthesizeMouseAtCenter( + shadowRoot.getElementById("calendar-button"), + {} + ); + + let popup = await shown; + ok(!!popup, "Should've shown the popup"); + + let hidden = BrowserTestUtils.waitForPopupEvent(popup, "hidden"); + popup.hidePopup(); + + await hidden; + popup.remove(); +}); |