1
0
Fork 0
firefox/toolkit/content/tests/browser/datetime/browser_datetime_toplevel.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

27 lines
741 B
JavaScript

/* 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();
});