summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/data/keyevent.html
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 17:46:40 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 17:46:40 +0000
commit24a20e0d58bfc9c176930f90b4ea3245fa742815 (patch)
tree747dc184de34af34e394d80b7b04bb12531aba28 /chrome_frame/test/data/keyevent.html
parentdd807ba64f2a3c276757010fcb488f5dc3b5722e (diff)
downloadchromium_src-24a20e0d58bfc9c176930f90b4ea3245fa742815.zip
chromium_src-24a20e0d58bfc9c176930f90b4ea3245fa742815.tar.gz
chromium_src-24a20e0d58bfc9c176930f90b4ea3245fa742815.tar.bz2
Added a regression test which validates that keystrokes are received correctly in ChromeFrame. We specifically
test for uppercase characters generated in combination with the Shift key. Added a helper function to explicitly give focus to a passed in HWND. This is done by sending the mouse move/mouse down and mouse up events to the window. We also use this in the AboutChromeFrame test, which was flaky at times. Bug=27173,26549 Review URL: http://codereview.chromium.org/389029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/data/keyevent.html')
-rw-r--r--chrome_frame/test/data/keyevent.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome_frame/test/data/keyevent.html b/chrome_frame/test/data/keyevent.html
new file mode 100644
index 0000000..73c5e40
--- /dev/null
+++ b/chrome_frame/test/data/keyevent.html
@@ -0,0 +1,36 @@
+<html>
+ <head>
+ <meta http-equiv="x-ua-compatible" content="chrome=1" />
+ <title>ChromeFrame keyevent test</title>
+ <script type="text/javascript"
+ src="chrome_frame_tester_helpers.js"></script>
+
+ <script type="text/javascript">
+ function ValidateUserAgent() {
+ if (isRunningInMSIE()) {
+ onFailure("FullTab_KeyboardTest", 1, "Failed");
+ }
+ }
+
+ var key_count = 0;
+ var input_string = "";
+
+ function OnKeyPress() {
+ if (key_count <= 6) {
+ input_string += String.fromCharCode(event.keyCode).toString();
+ }
+
+ if (input_string == "Chrome") {
+ onSuccess("FullTab_KeyboardTest", 1);
+ } else if (key_count >= 6) {
+ onFailure("FullTab_KeyboardTest", 1, "Invalid input string");
+ }
+ }
+ </script>
+ </head>
+
+ <body onLoad="setTimeout(ValidateUserAgent, 100);" onkeypress="OnKeyPress()">
+ ChromeFrame full tab mode keyboard test. Verifies that keypress events make
+ it correctly into ChromeFrame.
+ </body>
+</html>