<!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=week value="2012-W12" min="2012-W02" max="2012-W08" list=suggestions>
<datalist id=suggestions>
<option>2012-W01</option>
<option>2012-W02</option>
<option>2012-W03</option>
<option>2012-W04</option>
<option>2012-W05</option>
<option>2012-W06</option>
<option>2012-W07</option>
<option>2012-W08</option>
<option>2012-W09</option>
<option>2012-W10</option>
</datalist>
<script>
window.onload = () => {
const element = document.querySelector('input');
promise_test(() => {
return openPicker(element)
.then(() => {
internals.pagePopupWindow.focus();
assert_equals(entryValues().length, 8);
assert_equals(entryValues()[0], '2012-W02');
assert_equals(entryValues()[1], '2012-W03');
assert_equals(entryValues()[2], '2012-W04');
assert_equals(entryValues()[3], '2012-W05');
assert_equals(entryValues()[4], '2012-W06');
assert_equals(entryValues()[5], '2012-W07');
assert_equals(entryValues()[6], '2012-W08');
assert_equals(entryValues()[7], '@openCalendarPicker');
return attemptToClosePicker(element);
});
},'min/max attributes filter out suggestions');
};
</script>