summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 09:23:34 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 09:23:34 +0000
commit23f4d27695261961871a87a7014018582e016393 (patch)
tree9f74a3be6ab06906ac07b926730cb59b737534ca
parent041cc77a3e315fa6b5230c825726d919327dd4a1 (diff)
downloadchromium_src-23f4d27695261961871a87a7014018582e016393.zip
chromium_src-23f4d27695261961871a87a7014018582e016393.tar.gz
chromium_src-23f4d27695261961871a87a7014018582e016393.tar.bz2
A quick fix for Issue 20332
Sorry for a layout-test failure caused by my WebKit change. I forgot sending this change that implements code that makes test_shell sends function-key events when submitting my WebKit change. BUG=20332 "Need to implement the handling of function key values passed to EventSendingController::keyDown" TEST=LayoutTests/fast/events/keydown-function-keys.html Review URL: http://codereview.chromium.org/174601 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24726 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/layout_tests/test_expectations.txt1
-rw-r--r--webkit/tools/test_shell/event_sending_controller.cc24
2 files changed, 19 insertions, 6 deletions
diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt
index 6ad6708..25d3d86 100644
--- a/webkit/tools/layout_tests/test_expectations.txt
+++ b/webkit/tools/layout_tests/test_expectations.txt
@@ -2727,7 +2727,6 @@ BUG20340 MAC : LayoutTests/fast/forms/button-state-restore.html = CRASH
BUG20341 : LayoutTests/loader/go-back-to-different-window-size.html = TIMEOUT
// WebKit 47732:47748.
-BUG20332 : LayoutTests/fast/events/keydown-function-keys.html = FAIL
BUG20324 WIN LINUX : LayoutTests/http/tests/security/javascriptURL/javascriptURL-in-new-iframe.html = CRASH
// WebKit 47748:47759. Crash only on Linux. Need investigation.
diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc
index 7165bb6..42402f0 100644
--- a/webkit/tools/test_shell/event_sending_controller.cc
+++ b/webkit/tools/test_shell/event_sending_controller.cc
@@ -375,7 +375,7 @@ void EventSendingController::keyDown(
// Convert \n -> VK_RETURN. Some layout tests use \n to mean "Enter", when
// Windows uses \r for "Enter".
- int code;
+ int code = 0;
bool needs_shift_key_modifier = false;
if (L"\n" == code_str) {
generate_char = true;
@@ -399,10 +399,24 @@ void EventSendingController::keyDown(
} else if (L"end" == code_str) {
code = WebCore::VKEY_END;
} else {
- DCHECK(code_str.length() == 1);
- code = code_str[0];
- needs_shift_key_modifier = NeedsShiftModifier(code);
- generate_char = true;
+ // Compare the input string with the function-key names defined by the
+ // DOM spec (i.e. "F1",...,"F24"). If the input string is a function-key
+ // name, set its key code.
+ for (int i = 1; i <= 24; ++i) {
+ std::wstring function_key_name;
+ function_key_name += L"F";
+ function_key_name += IntToWString(i);
+ if (function_key_name == code_str) {
+ code = WebCore::VKEY_F1 + (i - 1);
+ break;
+ }
+ }
+ if (!code) {
+ DCHECK(code_str.length() == 1);
+ code = code_str[0];
+ needs_shift_key_modifier = NeedsShiftModifier(code);
+ generate_char = true;
+ }
}
// For one generated keyboard event, we need to generate a keyDown/keyUp