OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <meta http-equiv="x-ua-compatible" content="chrome=1" /> |
| 4 <script type="text/javascript" src="chrome_frame_tester_helpers.js"> |
| 5 </script> |
| 6 <script> |
| 7 // Default text value used to test cut/copy/paste etc. |
| 8 var INIT_VAL = "SomeInitializedTextValue"; |
| 9 |
| 10 // Verify the expected result based on action and post message to host. |
| 11 function verifyTextFieldContents(event) { |
| 12 var textField = document.getElementById("textField"); |
| 13 var selectedValue = textField.value.substring(textField.selectionStart, |
| 14 textField.selectionEnd); |
| 15 |
| 16 if (selectedValue == INIT_VAL) { |
| 17 window.externalHost.postMessage("OK"); |
| 18 } else { |
| 19 window.externalHost.postMessage("Fail"); |
| 20 } |
| 21 } |
| 22 |
| 23 // Do some initialization work like setting text field value, |
| 24 // and selecting the value by default before the test starts. |
| 25 function init() { |
| 26 var action = getURLParameter("action"); |
| 27 |
| 28 document.getElementById("textField").value = INIT_VAL; |
| 29 document.getElementById("textField").focus(); |
| 30 if (action != "selectall") { |
| 31 document.getElementById("textField").select(); |
| 32 } |
| 33 |
| 34 window.externalHost.onmessage = verifyTextFieldContents; |
| 35 } |
| 36 </script> |
| 37 </head> |
| 38 |
| 39 <body leftmargin="0" topmargin="0" onload="init()"> |
| 40 <input type="text" name="textField" id="textField" size="25" value=""></td> |
| 41 </body> |
| 42 </html> |
| 43 |
OLD | NEW |