<!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 src="../resources/picker-common.js"></script>
<script src="resources/suggestion-picker-common.js"></script>
<body style="background-color: #bbbbbb;">
<input type=datetime-local value="2012-11-20T12:00" min="2012-11-20T06:00" max="2012-11-21T12:00" list=suggestions>
<datalist id=suggestions>
<option>2012-11-19T18:00</option>
<option>2012-11-20T00:00</option>
<option>2012-11-20T06:00</option>
<option>2012-11-20T12:00</option>
<option>2012-11-20T18:00</option>
<option>2012-11-21T00:00</option>
<option>2012-11-21T06:00</option>
<option>2012-11-21T12:00</option>
<option>2012-11-21T18:00</option>
<option>2012-11-22T00:00</option>
</datalist>
<script>
window.onload = () => {
const element = document.querySelector('input');
promise_test(() => {
return openPicker(element)
.then(() => {
internals.pagePopupWindow.focus();
assert_equals(entryValues().length, 7);
assert_equals(entryValues()[0], '2012-11-20T06:00');
assert_equals(entryValues()[1], '2012-11-20T12:00');
assert_equals(entryValues()[2], '2012-11-20T18:00');
assert_equals(entryValues()[3], '2012-11-21T00:00');
assert_equals(entryValues()[4], '2012-11-21T06:00');
assert_equals(entryValues()[5], '2012-11-21T12:00');
assert_equals(entryValues()[6], '@openCalendarPicker');
return attemptToClosePicker(element);
});
},'min/max attributes filter out suggestions');
};
</script>