Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / time-multiple-fields / time-multiple-fields-fallback-format.html
bloba834c00925fbe1bd106ccc1fe966c354f0f7af2a
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('Checks incomplete datetime formats are rejected.');
11 var input = document.createElement('input');
12 input.type = 'time';
13 document.body.appendChild(input);
15 function setDateTimeFormat(pattern) {
16 var value = input.value;
17 getElementByPseudoId(internals.youngestShadowRoot(input), '-webkit-datetime-edit').setAttribute('pattern', pattern);
18 input.value = ''; // Updates the element for new format
19 input.value = value;
22 input.value = '23:59:01.234';
24 debug('Valid format');
25 setDateTimeFormat('ss:mm:hh a');
26 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '01.234:59:11 PM');
27 setDateTimeFormat('ss:mm:HH');
28 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '01.234:59:23');
29 setDateTimeFormat('ss:mm:HH a');
30 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '01.234:59:23 PM');
32 debug('Invalid format, fallback to HH:mm:ss');
33 setDateTimeFormat('HH');
34 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '23:59:01.234');
35 setDateTimeFormat('mm:ss');
36 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '23:59:01.234');
37 setDateTimeFormat('hh:mm:ss');
38 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '23:59:01.234');
40 </script>
41 </body>
42 </html>