chromium/third_party/blink/web_tests/fast/forms/week/input-valueasnumber-week-expected.txt

Tests for .valueAsNumber with <input type=week>.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

PASS valueAsNumberFor("") is Number.NaN
PASS valueAsNumberFor("2007-W01") is Date.UTC(2007, 0, 1)
PASS valueAsNumberFor("2008-W01") is Date.UTC(2007, 11, 31)
PASS valueAsNumberFor("2003-W01") is Date.UTC(2002, 11, 30)
PASS valueAsNumberFor("2004-W01") is Date.UTC(2003, 11, 29, 0, 0, 0, 0)
PASS valueAsNumberFor("2010-W01") is Date.UTC(2010, 0, 4)
PASS valueAsNumberFor("2005-W01") is Date.UTC(2005, 0, 3)
PASS valueAsNumberFor("2006-W01") is Date.UTC(2006, 0, 2)
Various January 1st:
PASS setValueAsNumberAndGetValue(2007, 0, 1) is "2007-W01"
PASS setValueAsNumberAndGetValue(2008, 0, 1) is "2008-W01"
PASS setValueAsNumberAndGetValue(2003, 0, 1) is "2003-W01"
PASS setValueAsNumberAndGetValue(2004, 0, 1) is "2004-W01"
PASS setValueAsNumberAndGetValue(2010, 0, 1) is "2009-W53"
PASS setValueAsNumberAndGetValue(2005, 0, 1) is "2004-W53"
PASS setValueAsNumberAndGetValue(2006, 0, 1) is "2005-W52"
Normal cases:
PASS setValueAsNumberAndGetValue(2010, 0, 3) is "2009-W53"
PASS setValueAsNumberAndGetValue(2010, 0, 4) is "2010-W01"
PASS setValueAsNumberAndGetValue(2010, 0, 10) is "2010-W01"
PASS setValueAsNumberAndGetValue(2010, 0, 11) is "2010-W02"
PASS setValueAsNumberAndGetValue(2010, 0, 17) is "2010-W02"
PASS setValueAsNumberAndGetValue(2010, 11, 31) is "2010-W52"
Around the minimum/maximum values:
PASS setValueAsNumberAndGetValue(0, 11, 31) is ""
PASS setValueAsNumberAndGetValue(1, 0, 1) is "0001-W01"
PASS setValueAsNumberAndGetValue(275760, 8, 8) is "275760-W37"
PASS setValueAsNumberAndGetValue(275760, 8, 13) is "275760-W37"
Tests to set invalid values to valueAsNumber:
PASS input.value = ""; input.valueAsNumber = null; input.value is "1970-W01"
PASS input.valueAsNumber = "foo"; input.valueAsNumber is NaN
PASS input.valueAsNumber = "foo"; input.value is ""
PASS input.valueAsNumber = NaN; input.valueAsNumber is NaN
PASS input.valueAsNumber = NaN; input.value is ""
PASS input.valueAsNumber = Number.NaN; input.valueAsNumber is NaN
PASS input.valueAsNumber = Number.NaN; input.value is ""
PASS input.valueAsNumber = Infinity threw exception TypeError: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The value provided is infinite..
PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception TypeError: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The value provided is infinite..
PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception TypeError: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The value provided is infinite..
PASS input.valueAsNumber = Date.UTC(275760, 8, 14); input.valueAsNumber is NaN
PASS input.valueAsNumber = Date.UTC(275760, 8, 14); input.value is ""
PASS successfullyParsed is true

TEST COMPLETE