diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 20:28:32 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 20:28:32 +0000 |
commit | 64e12916f5f9410512a34b96cc706e6ccf63ec46 (patch) | |
tree | e81dae32238ea1557c94ce11fdd068c73f8b9280 | |
parent | e7a023be01011f2a2734e2c72d1d2c632a86e272 (diff) | |
download | chromium_src-64e12916f5f9410512a34b96cc706e6ccf63ec46.zip chromium_src-64e12916f5f9410512a34b96cc706e6ccf63ec46.tar.gz chromium_src-64e12916f5f9410512a34b96cc706e6ccf63ec46.tar.bz2 |
Don't special case certain characters in event_sending_controller.cc
Remove a pending test that has been upstreamed.
Review URL: http://codereview.chromium.org/17064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7604 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 16 insertions, 163 deletions
diff --git a/webkit/data/layout_tests/pending/fast/events/special-key-events-in-input-text-expected.txt b/webkit/data/layout_tests/pending/fast/events/special-key-events-in-input-text-expected.txt deleted file mode 100644 index 40dece0..0000000 --- a/webkit/data/layout_tests/pending/fast/events/special-key-events-in-input-text-expected.txt +++ /dev/null @@ -1,37 +0,0 @@ -To test manually, press keys and compare results to other browsers. - - -target - type - ctrlKey,altKey,shiftKey,metaKey - keyIdentifier - keyCode - charCode -Ampersand: -INPUT - keydown - false,false,true,false - U+0037 - 55 - 0. Value: "". -INPUT - keypress - false,false,true,false - - 38 - 38. Value: "". -INPUT - textInput - &. Value: "". -INPUT - keyup - false,false,true,false - U+0037 - 55 - 0. Value: "&". -Backspace: -INPUT - keydown - false,false,false,false - U+0008 - 8 - 0. Value: "&". -INPUT - keyup - false,false,false,false - U+0008 - 8 - 0. Value: "". -Percent: -INPUT - keydown - false,false,true,false - U+0035 - 53 - 0. Value: "". -INPUT - keypress - false,false,true,false - - 37 - 37. Value: "". -INPUT - textInput - %. Value: "". -INPUT - keyup - false,false,true,false - U+0035 - 53 - 0. Value: "%". -Backspace: -INPUT - keydown - false,false,false,false - U+0008 - 8 - 0. Value: "%". -INPUT - keyup - false,false,false,false - U+0008 - 8 - 0. Value: "". -Left parentheses: -INPUT - keydown - false,false,true,false - U+0039 - 57 - 0. Value: "". -INPUT - keypress - false,false,true,false - - 40 - 40. Value: "". -INPUT - textInput - (. Value: "". -INPUT - keyup - false,false,true,false - U+0039 - 57 - 0. Value: "(". -Backspace: -INPUT - keydown - false,false,false,false - U+0008 - 8 - 0. Value: "(". -INPUT - keyup - false,false,false,false - U+0008 - 8 - 0. Value: "". -Right parentheses: -INPUT - keydown - false,false,true,false - U+0030 - 48 - 0. Value: "". -INPUT - keypress - false,false,true,false - - 41 - 41. Value: "". -INPUT - textInput - ). Value: "". -INPUT - keyup - false,false,true,false - U+0030 - 48 - 0. Value: ")". -Backspace: -INPUT - keydown - false,false,false,false - U+0008 - 8 - 0. Value: ")". -INPUT - keyup - false,false,false,false - U+0008 - 8 - 0. Value: "". - diff --git a/webkit/data/layout_tests/pending/fast/events/special-key-events-in-input-text.html b/webkit/data/layout_tests/pending/fast/events/special-key-events-in-input-text.html deleted file mode 100644 index 5ed8819..0000000 --- a/webkit/data/layout_tests/pending/fast/events/special-key-events-in-input-text.html +++ /dev/null @@ -1,58 +0,0 @@ -<p>To test manually, press keys and compare results to other browsers.</p> -<input type="text"></input> -<div id="log"></div> - -<script> -function log(msg) { - document.getElementById("log").innerHTML+= msg + "<br />"; -} - -function logEvent(e) { - var target = e.target; - var type = e.type; - - var info = target.tagName + " - " + type + ' - '; - if (type == "textInput") { - info += e.data; - } else if (type == "keydown" || type == "keypress" || type == "keyup") { - info += [e.ctrlKey, e.altKey, e.shiftKey, e.metaKey] + - ' - ' + e.keyIdentifier + - ' - ' + e.keyCode + - ' - ' + e.charCode; - } - info += '. Value: "' + target.value + '".'; - log(info); -} - -log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey"] - + ' - ' + "keyIdentifier" - + ' - ' + "keyCode" - + ' - ' + "charCode"); - -var input = document.getElementsByTagName("input")[0]; -input.addEventListener('textInput', logEvent, false); -input.addEventListener('keypress', logEvent, false); -input.addEventListener('keydown', logEvent, false); -input.addEventListener('keyup', logEvent, false); -input.focus(); - -if (window.layoutTestController) { - layoutTestController.dumpAsText(); - log("Ampersand:"); - eventSender.keyDown("7", ["shiftKey"]); - log("Backspace:"); - eventSender.keyDown("\x08", []); - log("Percent:"); - eventSender.keyDown("5", ["shiftKey"]); - log("Backspace:"); - eventSender.keyDown("\x08", []); - log("Left parentheses:"); - eventSender.keyDown("9", ["shiftKey"]); - log("Backspace:"); - eventSender.keyDown("\x08", []); - log("Right parentheses:"); - eventSender.keyDown("0", ["shiftKey"]); - log("Backspace:"); - eventSender.keyDown("\x08", []); - } -</script>
\ No newline at end of file diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index d78a624..0d6f120 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -997,7 +997,6 @@ LINUX MAC : pending/plugins/destroy-stream-twice.html = TIMEOUT LINUX MAC : pending/plugins/iframe-shims.html = FAIL // Depends on event_sending_controller fixes. -MAC : pending/fast/events/special-key-events-in-input-text.html = FAIL MAC : LayoutTests/fast/forms/search-event-delay.html = FAIL // NEW FOR MERGE 36102:37604 @@ -1624,7 +1623,7 @@ LINUX WIN : LayoutTests/fast/repaint/transform-repaint-descendants.html = FAIL LINUX WIN : LayoutTests/http/tests/loading/simple-subframe.html = FAIL // WebKit Merge 39100:39141 new tests: -LayoutTests/fast/events/special-key-events-in-input-text.html = FAIL +MAC : LayoutTests/fast/events/special-key-events-in-input-text.html = FAIL LayoutTests/fast/regex/non-pattern-characters.html = FAIL SKIP : LayoutTests/fast/workers/worker-navigator.html = FAIL SKIP : LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-image-not-loaded-svg.svg = FAIL diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc index a603524..9a82184 100644 --- a/webkit/tools/test_shell/event_sending_controller.cc +++ b/webkit/tools/test_shell/event_sending_controller.cc @@ -198,7 +198,7 @@ int EventSendingController::GetButtonNumberFromSingleArg( // Implemented javascript methods. // - void EventSendingController::mouseDown( +void EventSendingController::mouseDown( const CppArgumentList& args, CppVariant* result) { result->SetNull(); @@ -227,7 +227,7 @@ int EventSendingController::GetButtonNumberFromSingleArg( webview()->HandleInputEvent(&event); } - void EventSendingController::mouseUp( +void EventSendingController::mouseUp( const CppArgumentList& args, CppVariant* result) { result->SetNull(); @@ -274,7 +274,7 @@ int EventSendingController::GetButtonNumberFromSingleArg( } } - void EventSendingController::mouseMoveTo( +void EventSendingController::mouseMoveTo( const CppArgumentList& args, CppVariant* result) { result->SetNull(); @@ -304,21 +304,10 @@ int EventSendingController::GetButtonNumberFromSingleArg( } } - void EventSendingController::keyDown( +void EventSendingController::keyDown( const CppArgumentList& args, CppVariant* result) { result->SetNull(); - static const int kPercentVirtualKeyCode = 0x25; - static const int kAmpersandVirtualKeyCode = 0x26; - - static const int kLeftParenthesesVirtualKeyCode = 0x28; - static const int kRightParenthesesVirtualKeyCode = 0x29; - -#if defined(OS_WIN) - static const int kLeftCurlyBracketVirtualKeyCode = 0x7B; - static const int kRightCurlyBracketVirtualKeyCode = 0x7D; -#endif - bool generate_char = false; if (args.size() >= 1 && args[0].isString()) { @@ -384,47 +373,7 @@ int EventSendingController::GetButtonNumberFromSingleArg( if (generate_char) { WebKeyboardEvent event_char = event_down; - if (event_down.modifiers & WebInputEvent::SHIFT_KEY) { - // Special case for the following characters when the shift key is - // pressed in conjunction with these characters. - // Windows generates a WM_KEYDOWN message with the ASCII code of - // the character followed by a WM_CHAR for the corresponding - // virtual key code. - // We check for these keys to catch regressions in keyEvent handling - // in webkit. - switch(code) { - case '5': - event_char.key_code = kPercentVirtualKeyCode; - break; - case '7': - event_char.key_code = kAmpersandVirtualKeyCode; - break; - case '9': - event_char.key_code = kLeftParenthesesVirtualKeyCode; - break; - case '0': - event_char.key_code = kRightParenthesesVirtualKeyCode; - break; -#if defined(OS_WIN) - // '[{' for US - case VK_OEM_4: - event_char.key_code = kLeftCurlyBracketVirtualKeyCode; - break; - // ']}' for US - case VK_OEM_6: - event_char.key_code = kRightCurlyBracketVirtualKeyCode; - break; -#endif - default: - break; - } - } event_char.type = WebInputEvent::CHAR; -#if defined(OS_LINUX) - // |key_code| may have changed, so update |text|. - // (See deanm comment above.) - event_char.text = event_char.key_code; -#endif webview()->HandleInputEvent(&event_char); } @@ -432,7 +381,7 @@ int EventSendingController::GetButtonNumberFromSingleArg( } } - bool EventSendingController::NeedsShiftModifer(int key_code) { +bool EventSendingController::NeedsShiftModifer(int key_code) { // If code is an uppercase letter, assign a SHIFT key to // event_down.modifier, this logic comes from // WebKit/WebKitTools/DumpRenderTree/Win/EventSender.cpp @@ -441,7 +390,7 @@ int EventSendingController::GetButtonNumberFromSingleArg( return false; } - void EventSendingController::leapForward( +void EventSendingController::leapForward( const CppArgumentList& args, CppVariant* result) { result->SetNull(); @@ -454,19 +403,19 @@ int EventSendingController::GetButtonNumberFromSingleArg( // Apple's port of webkit zooms by a factor of 1.2 (see // WebKit/WebView/WebView.mm) - void EventSendingController::textZoomIn( +void EventSendingController::textZoomIn( const CppArgumentList& args, CppVariant* result) { webview()->ZoomIn(true); result->SetNull(); } - void EventSendingController::textZoomOut( +void EventSendingController::textZoomOut( const CppArgumentList& args, CppVariant* result) { webview()->ZoomOut(true); result->SetNull(); } - void EventSendingController::ReplaySavedEvents() { +void EventSendingController::ReplaySavedEvents() { replaying_saved_events = true; while (!mouse_event_queue.empty()) { WebMouseEvent event = mouse_event_queue.front(); @@ -483,14 +432,14 @@ int EventSendingController::GetButtonNumberFromSingleArg( NOTREACHED(); } } - + replaying_saved_events = false; } - void EventSendingController::contextClick( +void EventSendingController::contextClick( const CppArgumentList& args, CppVariant* result) { result->SetNull(); - + webview()->Layout(); if (GetCurrentEventTimeSec() - last_click_time_sec >= 1) { @@ -518,17 +467,17 @@ int EventSendingController::GetButtonNumberFromSingleArg( // Unimplemented stubs // - void EventSendingController::enableDOMUIEventLogging( +void EventSendingController::enableDOMUIEventLogging( const CppArgumentList& args, CppVariant* result) { result->SetNull(); } - void EventSendingController::fireKeyboardEventsToElement( +void EventSendingController::fireKeyboardEventsToElement( const CppArgumentList& args, CppVariant* result) { result->SetNull(); } - void EventSendingController::clearKillRing( +void EventSendingController::clearKillRing( const CppArgumentList& args, CppVariant* result) { result->SetNull(); } |