| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../../../../fast/js/resources/js-test-pre.js"></script> | |
| 5 <script src="../../../../../fast/forms/resources/picker-common.js"></script> | |
| 6 <script src="resources/suggestion-picker-common.js"></script> | |
| 7 </head> | |
| 8 <body> | |
| 9 <script> | |
| 10 description('Checks reloading page resets input values'); | |
| 11 | |
| 12 var iframe; | |
| 13 var testInput1; | |
| 14 var testInput2; | |
| 15 | |
| 16 function runOnOpenPopup1() { | |
| 17 iframe = document.getElementById('iframe'); | |
| 18 | |
| 19 popupWindow.focus(); | |
| 20 | |
| 21 shouldBeNull('highlightedEntry()'); | |
| 22 eventSender.keyDown('downArrow'); | |
| 23 shouldBeEqualToString('highlightedEntry()', '2012-01-01T00:00Z'); | |
| 24 eventSender.keyDown('\n'); | |
| 25 waitUntilClosing(runOnOpenPopup1AfterClosing); | |
| 26 } | |
| 27 | |
| 28 function runOnOpenPopup1AfterClosing() { | |
| 29 shouldBeNull('document.getElementById("mock-page-popup")'); | |
| 30 shouldBeEqualToString('iframe.contentDocument.getElementById("test1").value'
, '2012-01-01T00:00Z'); | |
| 31 | |
| 32 openPicker(iframe.contentDocument.getElementById('test2'), runOnOpenPopup2); | |
| 33 } | |
| 34 | |
| 35 function runOnOpenPopup2() { | |
| 36 popupWindow.focus(); | |
| 37 | |
| 38 shouldBeNull('highlightedEntry()'); | |
| 39 eventSender.keyDown('downArrow'); | |
| 40 shouldBeEqualToString('highlightedEntry()', '2012-01-01T00:00Z'); | |
| 41 eventSender.keyDown('\n'); | |
| 42 waitUntilClosing(runOnOpenPopup2AfterClosing); | |
| 43 } | |
| 44 | |
| 45 function runOnOpenPopup2AfterClosing() { | |
| 46 shouldBeNull('document.getElementById("mock-page-popup")'); | |
| 47 shouldBeEqualToString('iframe.contentDocument.getElementById("test2").value'
, '2012-01-01T00:00Z'); | |
| 48 | |
| 49 iframe.addEventListener('load', function () { parent.runOnIFrameLoad(); }); | |
| 50 iframe.contentWindow.location.reload(); | |
| 51 } | |
| 52 | |
| 53 function runOnIFrameLoad() | |
| 54 { | |
| 55 testInput1 = iframe.contentDocument.getElementById('test1'); | |
| 56 testInput2 = iframe.contentDocument.getElementById('test2'); | |
| 57 shouldBeEqualToString('testInput1.value', ''); | |
| 58 shouldBeEqualToString('testInput2.value', '2002-02-02T00:00Z'); | |
| 59 iframe.parentNode.removeChild(iframe); | |
| 60 waitUntilClosing(finishJSTest); | |
| 61 } | |
| 62 </script> | |
| 63 <iframe id=iframe onload="openPicker(event.target.contentDocument.getElementById
('test1'), runOnOpenPopup1);" srcdoc="<input type=datetime id=test1 list=suggest
ions><input type=datetime id=test2 value=2002-02-02T00:00Z list=suggestions><dat
alist id=suggestions><option>2012-01-01T00:00Z</option></datalist>"></iframe> | |
| 64 <script src="../../../../../fast/js/resources/js-test-post.js"></script> | |
| 65 </body> | |
| 66 </html> | |
| OLD | NEW |