 Chromium Code Reviews
 Chromium Code Reviews Issue 484353004:
  Test tidying: use "escape" and "backspace" with eventSender.keyDown()  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 484353004:
  Test tidying: use "escape" and "backspace" with eventSender.keyDown()  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> | 
| 2 <html> | 2 <html> | 
| 3 <head> | 3 <head> | 
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> | 
| 5 <script src="../../forms/resources/picker-common.js"></script> | 5 <script src="../../forms/resources/picker-common.js"></script> | 
| 6 <script src="resources/suggestion-picker-common.js"></script> | 6 <script src="resources/suggestion-picker-common.js"></script> | 
| 7 </head> | 7 </head> | 
| 8 <body style="background-color: #bbbbbb;"> | 8 <body style="background-color: #bbbbbb;"> | 
| 9 <p id="description"></p> | 9 <p id="description"></p> | 
| 10 <div id="console"></div> | 10 <div id="console"></div> | 
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 openPicker(document.getElementById('datetime-local')); | 138 openPicker(document.getElementById('datetime-local')); | 
| 139 popupWindow.addEventListener('resize', test2, false); | 139 popupWindow.addEventListener('resize', test2, false); | 
| 140 } | 140 } | 
| 141 | 141 | 
| 142 function test2() { | 142 function test2() { | 
| 143 popupWindow.removeEventListener('resize', test2, false); | 143 popupWindow.removeEventListener('resize', test2, false); | 
| 144 | 144 | 
| 145 popupWindow.focus(); | 145 popupWindow.focus(); | 
| 146 | 146 | 
| 147 debug('Check that escape key closes the popup.'); | 147 debug('Check that escape key closes the popup.'); | 
| 148 eventSender.keyDown('\x1B'); | 148 eventSender.keyDown("escape"); | 
| 
keishi
2014/08/22 07:22:32
nit: string literals in this file are using single
 | |
| 149 waitUntilClosing(test2AfterClosing); | 149 waitUntilClosing(test2AfterClosing); | 
| 150 } | 150 } | 
| 151 | 151 | 
| 152 function test2AfterClosing() { | 152 function test2AfterClosing() { | 
| 153 shouldBeNull('document.getElementById("mock-page-popup")'); | 153 shouldBeNull('document.getElementById("mock-page-popup")'); | 
| 154 shouldBeEqualToString('document.getElementById("datetime-local").value', '20 12-11-22T02:07'); | 154 shouldBeEqualToString('document.getElementById("datetime-local").value', '20 12-11-22T02:07'); | 
| 155 | 155 | 
| 156 sendKey(document.getElementById('datetime-local'), 'F4'); | 156 sendKey(document.getElementById('datetime-local'), 'F4'); | 
| 157 if (document.getElementById('mock-page-popup')) | 157 if (document.getElementById('mock-page-popup')) | 
| 158 testPassed('F4 opened picker.'); | 158 testPassed('F4 opened picker.'); | 
| 159 | 159 | 
| 160 finishJSTest(); | 160 finishJSTest(); | 
| 161 } | 161 } | 
| 162 | 162 | 
| 163 </script> | 163 </script> | 
| 164 </body> | 164 </body> | 
| 165 </html> | 165 </html> | 
| OLD | NEW |