OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <meta http-equiv="x-ua-compatible" content="chrome=1" /> | 3 <meta http-equiv="x-ua-compatible" content="chrome=1" /> |
4 <title>ChromeFrame keyevent test</title> | 4 <title>ChromeFrame keyevent test</title> |
5 <script type="text/javascript" | 5 <script type="text/javascript" |
6 src="chrome_frame_tester_helpers.js"></script> | 6 src="chrome_frame_tester_helpers.js"></script> |
7 | 7 |
8 <script type="text/javascript"> | 8 <script type="text/javascript"> |
9 function ValidateUserAgent() { | |
10 if (isRunningInMSIE()) { | |
11 onFailure("FullTab_KeyboardTest", 1, "Failed"); | |
12 } | |
13 } | |
14 | |
15 var key_count = 0; | |
16 var input_string = ""; | 9 var input_string = ""; |
17 | 10 |
18 function OnKeyPress() { | 11 function OnKeyPress() { |
19 if (key_count <= 6) { | 12 appendStatus("Key pressed: " + |
20 input_string += String.fromCharCode(event.keyCode).toString(); | 13 String.fromCharCode(event.keyCode).toString()); |
21 } | 14 input_string += String.fromCharCode(event.keyCode).toString(); |
22 | 15 |
23 if (input_string == "Chrome") { | 16 if (input_string.length >= 6) { |
24 onSuccess("FullTab_KeyboardTest", 1); | 17 appendStatus("Sending message: " + input_string); |
25 } else if (key_count >= 6) { | 18 window.externalHost.postMessage(input_string); |
26 onFailure("FullTab_KeyboardTest", 1, "Invalid input string"); | |
27 } | 19 } |
28 } | 20 } |
29 </script> | 21 </script> |
30 </head> | 22 </head> |
31 | 23 |
32 <body onLoad="setTimeout(ValidateUserAgent, 100);" onkeypress="OnKeyPress()"> | 24 <body onkeypress="OnKeyPress()"> |
33 ChromeFrame full tab mode keyboard test. Verifies that keypress events make | 25 ChromeFrame full tab mode keyboard test. Verifies that keypress events make |
34 it correctly into ChromeFrame. | 26 it correctly into ChromeFrame. |
| 27 <div id="statusPanel" style="border: 1px solid red; width: 100%"> |
| 28 Keyboard test running.... |
| 29 </div> |
35 </body> | 30 </body> |
36 </html> | 31 </html> |
OLD | NEW |