Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / week-multiple-fields / week-multiple-fields-stepup-stepdown-from-renderer.html
blob31a334d605295b14c74b74c4519a416105eb5ca9
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="../resources/common.js"></script>
6 </head>
7 <body>
8 <script>
9 description('Check stepping-up and -down for week input fields from renderer.');
10 if (!window.eventSender)
11 debug('This test requires eventSender.');
13 var input = document.createElement('input');
14 input.type = 'week';
15 document.body.appendChild(input);
17 function setInputAttributes(value, min, max) {
18 input.value = value;
19 input.min = min;
20 input.max = max;
23 function stepUp(value, min, max) {
24 setInputAttributes(value, min, max);
25 eventSender.keyDown('upArrow');
26 return input.value;
29 function stepDown(value, min, max) {
30 setInputAttributes(value, min, max);
31 eventSender.keyDown('downArrow');
32 return input.value;
35 input.focus();
36 debug('Function arguments are (value, min, max).');
37 debug('Week');
38 shouldBeEqualToString('stepUp("2000-W05", "2000-W05", "2000-W40")', '2000-W06');
39 shouldBeEqualToString('stepDown("2000-W05", "2000-W05", "2000-W40")', '2000-W40');
40 shouldBeEqualToString('stepUp("2000-W05", "2000-W02", "2000-W05")', '2000-W02');
41 shouldBeEqualToString('stepDown("2000-W05", "2000-W02", "2000-W05")', '2000-W04');
42 shouldBeEqualToString('stepUp("2000-W05", "2000-W08", "2000-W10")', '2000-W08');
43 shouldBeEqualToString('stepDown("2000-W05", "2000-W08", "2000-W10")', '2000-W10');
44 shouldBeEqualToString('stepUp("2000-W05", "2000-W03", "2000-W03")', '2000-W03');
45 shouldBeEqualToString('stepDown("2000-W05", "2000-W03", "2000-W03")', '2000-W03');
46 shouldBeEqualToString('stepUp("2000-W05", "2000-W03", "2001-W05")', '2000-W06');
47 shouldBeEqualToString('stepDown("2000-W05", "2000-W05", "2001-W08")', '2000-W04');
49 debug('Year');
50 eventSender.keyDown('rightArrow');
51 shouldBeEqualToString('stepUp("2000-W01", "2000-W01", "2009-W52")', '2001-W01');
52 shouldBeEqualToString('stepDown("2000-W01", "2000-W01", "2009-W52")', '2009-W01');
53 shouldBeEqualToString('stepUp("2000-W01", "1990-W01", "2000-W52")', '1990-W01');
54 shouldBeEqualToString('stepDown("2000-W01", "1990-W01", "2000-W52")', '1999-W01');
55 shouldBeEqualToString('stepUp("275760-W01", "1990-W01", null)', '1990-W01');
56 shouldBeEqualToString('stepDown("1990-W01", "1990-W01", null)', '275760-W01');
57 shouldBeEqualToString('stepUp("2000-W01", null, "2000-W52")', '0001-W01');
58 shouldBeEqualToString('stepDown("0001-W01", null, "2000-W52")', '2000-W01');
59 shouldBeEqualToString('stepUp("1990-W01", "2000-W01", "2009-W52")', '2000-W01');
60 shouldBeEqualToString('stepDown("1990-W01", "2000-W01", "2009-W52")', '2009-W01');
61 shouldBeEqualToString('stepUp("2020-W01", "2000-W01", "2000-W52")', '2000-W01');
62 shouldBeEqualToString('stepDown("2020-W01", "2000-W01", "2000-W52")', '2000-W01');
64 debug('');
65 input.remove();
66 </script>
67 </body>
68 </html>