<!DOCTYPE html>
<meta name=fuzzy content="maxDifference=0-3; totalPixels=0-1000">
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../resources/testdriver.js"></script>
<script src="../../../resources/testdriver-vendor.js"></script>
<script>
for (const inputType of ["date", "month", "week", "datetime-local", "time"]) {
promise_test(async (t) => {
const input = document.createElement("input");
input.setAttribute("type", inputType);
await test_driver.bless("show calendar picker");
input.showPicker();
assert_not_equals(internals.pagePopupWindow, null, "Picker is opened.");
input.blur();
assert_equals(internals.pagePopupWindow, null, "Picker is closed.");
}, `Calendar picker: showPicker() for input[type="${inputType}""] should show picker`);
}
</script>