| 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 </head> | 5 </head> |
| 6 <body onload="startTests()"> | 6 <body onload="startTests()"> |
| 7 | 7 |
| 8 <form action="input-image-submit.html" method=GET id=form> | 8 <form action="input-image-submit.html" method=GET id=form> |
| 9 <input type=hidden name=state id=state value=step1> | 9 <input type=hidden name=state id=state value=step1> |
| 10 <input type=image name=image id=image src="../resources/apple.gif" value=value> | 10 <input type=image name=image id=image src="../resources/apple.gif" value=value> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // Should have only image=value. | 99 // Should have only image=value. |
| 100 if (query.indexOf('image=value') == -1) { | 100 if (query.indexOf('image=value') == -1) { |
| 101 failAndDone('Changing to text on submit failed: ' + query); | 101 failAndDone('Changing to text on submit failed: ' + query); |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Step 3: Change the type to image on 'submit' event | 105 // Step 3: Change the type to image on 'submit' event |
| 106 state.value = 'to-image-on-submit'; | 106 state.value = 'to-image-on-submit'; |
| 107 image.type = 'text'; | 107 image.type = 'text'; |
| 108 image.focus(); | 108 image.focus(); |
| 109 eventSender.keyDown('\n'); | 109 eventSender.keyDown('Enter'); |
| 110 } else if (query.indexOf('state=to-image-on-submit') != -1) { | 110 } else if (query.indexOf('state=to-image-on-submit') != -1) { |
| 111 // Should have image.x and image.y, but their values are 0. | 111 // Should have image.x and image.y, but their values are 0. |
| 112 if (query.indexOf('image.x=0&image.y=0&image=value') == -1) { | 112 if (query.indexOf('image.x=0&image.y=0&image=value') == -1) { |
| 113 failAndDone('Changing to image on submit failed: ' + query); | 113 failAndDone('Changing to image on submit failed: ' + query); |
| 114 return; | 114 return; |
| 115 } | 115 } |
| 116 | 116 |
| 117 // Step 4: Change the type to image on 'click' event | 117 // Step 4: Change the type to image on 'click' event |
| 118 state.value = 'to-image-on-click'; | 118 state.value = 'to-image-on-click'; |
| 119 image.type = 'text'; | 119 image.type = 'text'; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 134 testFailed('Removing the input on submit failed: ' + query); | 134 testFailed('Removing the input on submit failed: ' + query); |
| 135 else | 135 else |
| 136 testPassed('All tests passed.'); | 136 testPassed('All tests passed.'); |
| 137 notifyDone(); | 137 notifyDone(); |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 </script> | 140 </script> |
| 141 </body> | 141 </body> |
| 142 </html> | 142 </html> |
| 143 | 143 |
| OLD | NEW |