Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / forms / calendar-picker / calendar-picker-should-not-change-datetimelocal-time.html
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.');
12
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);
17
18 input.value = '1999-07-31T12:59';
19
20 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '1999-07-31 12:59');
21 openPickerWithMock(input, function() {
22     shouldBeEqualToString('getUserAgentShadowTextContent(input)', '1999-07-31 12:59');
23
24     eventSender.keyDown('rightArrow');
25     shouldBeEqualToString('highlightedValue()', '1999-08-01');
26
27     removeCommitDelay();
28     eventSender.keyDown('\n');
29     shouldBeEqualToString('selectedValue()', '1999-08-01');
30
31     shouldBeEqualToString('getUserAgentShadowTextContent(input)', '1999-08-01 12:59');
32     finishJSTest();
33 });
34
35 </script>
36 </body>
37 </html>