Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / calendar-picker / calendar-picker-should-not-change-datetimelocal-time.html
blob8ffc03f29a5b75b30130803a78f3a134d37413c9
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="../../forms/resources/picker-common.js"></script>
6 <script src="../resources/common.js"></script>
7 <script src="resources/calendar-picker-common.js"></script>
8 </head>
9 <body>
10 <script>
11 description('Test for crbug.com/271451. The calendar picker should not change the time part of datetime-local field.');
13 var input = document.createElement('input');
14 input.type = 'datetime-local';
15 getElementByPseudoId(internals.youngestShadowRoot(input), '-webkit-datetime-edit').setAttribute('pattern', 'yyyy-MM-dd HH:mm');
16 document.body.appendChild(input);
18 input.value = '1999-07-31T12:59';
20 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '1999-07-31 12:59');
21 openPicker(input, function() {
22 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '1999-07-31 12:59');
24 eventSender.keyDown('rightArrow');
25 shouldBeEqualToString('highlightedValue()', '1999-08-01');
27 removeCommitDelay();
28 eventSender.keyDown('\n');
29 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '1999-08-01 12:59');
30 finishJSTest();
31 });
33 </script>
34 </body>
35 </html>