Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / week-multiple-fields / resources / preserve-value-after-history-back-frame.html
blob842d8af8a3d710652d5436516369b8f9350a4ee8
1 <!DOCTYPE html>
2 <body>
3 <input type="week" id="test1">
4 <input type="week" id="test2" min="1998-W01" max="1999-W12">
5 <script>
6 function fieldsText(input) {
7 return window.internals.oldestShadowRoot(input).textContent;
10 function back(newState) {
11 parent.state = newState;
12 history.back();
15 function forward(newState) {
16 parent.state = newState;
17 history.forward();
20 function keyDown(key) {
21 eventSender.keyDown(key);
24 var testInput1 = document.getElementById('test1');
25 var testInput2 = document.getElementById('test2');
26 var pageName = location.search || '?page1';
28 window.onload = function() {
29 switch (pageName) {
30 case '?page1':
31 switch (parent.state) {
32 case 'direct': {
33 testInput1.value = '12012-W10';
34 testInput2.focus();
35 keyDown('upArrow'); // -> Week [01], yyyy
36 var nextUri = location.toString().replace('?page1', '?page2');
37 setTimeout(function() { window.location.href = nextUri; }, 0);
38 break;
40 case 'backTo1':
41 parent.testCases.push(
43 'description' : 'Went back to a page. Checking a form control which had a full value',
44 'actual' : testInput1.value,
45 'expected' : '12012-W10' },
47 'description' : 'Went back to a page. Checking a form control which had a partial value',
48 'actual' : fieldsText(testInput2),
49 'expected' : 'Week 01, ----'
50 });
51 forward('forwardTo2');
52 break;
53 case 'backTo1Second':
54 parent.finishTest();
55 break;
56 default:
57 parent.failed('Unexpected state(' + parent.state + ')');
58 break;
60 break;
62 case '?page2':
63 switch (parent.state) {
64 case 'direct':
65 testInput1.value = '0001-W11';
66 testInput2.focus();
67 keyDown('\t'); // -> Week ww, [yyyy]
68 keyDown('downArrow'); // -> Week ww, [1999]
69 back('backTo1');
70 break;
71 case 'forwardTo2':
72 parent.testCases.push(
74 'description' : 'Went forward to a page. Checking a form control which had a full value',
75 'actual' : testInput1.value,
76 'expected' : '0001-W11'
79 'description' : 'Went forward to a page. Checking a form control which had a partial value',
80 'actual' : fieldsText(testInput2),
81 'expected' : 'Week --, 1999'
82 });
83 back('backTo1Second');
84 break;
85 default:
86 parent.failed('Unexpected state(' + parent.state + ')');
87 break;
89 break;
91 default:
92 parent.failed('Unexpected page(' + pageName + ')');
93 break;
96 </script>
97 </body>