diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-28 21:18:58 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-28 21:18:58 +0000 |
commit | d766882c913b272cc2db478d7640a317d838ebad (patch) | |
tree | 99424c7a994d0d771bd4c3bdf2b196042b937b62 /chrome/test | |
parent | eb75208190b35bedd144e102ea5cc826358bbbfd (diff) | |
download | chromium_src-d766882c913b272cc2db478d7640a317d838ebad.zip chromium_src-d766882c913b272cc2db478d7640a317d838ebad.tar.gz chromium_src-d766882c913b272cc2db478d7640a317d838ebad.tar.bz2 |
Changing the KeyboardEvent to use a KeyboardCode instead of a w_char. Led to several places where I had to switch from VK_ to VKEY_.
Also cleaned-up the table view OnKeyDown method. Since TableView is a NativeControl it can use the NativeControl::OnKeyDown directly.
BUG=None
TEST=Make sure short-cuts works as expected, especially in the omnibox.
Review URL: http://codereview.chromium.org/248010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27412 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_tests.cc | 3 | ||||
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_tests.h | 3 | ||||
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 4 | ||||
-rw-r--r-- | chrome/test/automation/window_proxy.cc | 2 | ||||
-rw-r--r-- | chrome/test/automation/window_proxy.h | 11 | ||||
-rw-r--r-- | chrome/test/interactive_ui/npapi_interactive_test.cc | 3 | ||||
-rw-r--r-- | chrome/test/ui/npapi_uitest.cc | 3 |
7 files changed, 17 insertions, 12 deletions
diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index 252689c..fd22151 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -607,7 +607,8 @@ bool AutomatedUITest::ForceCrash() { return true; } -bool AutomatedUITest::SimulateKeyPressInActiveWindow(wchar_t key, int flags) { +bool AutomatedUITest::SimulateKeyPressInActiveWindow(base::KeyboardCode key, + int flags) { scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); if (window.get() == NULL) { AddErrorAttribute("active_window_not_found"); diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.h b/chrome/test/automated_ui_tests/automated_ui_tests.h index d370b70..286234a 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.h +++ b/chrome/test/automated_ui_tests/automated_ui_tests.h @@ -102,6 +102,7 @@ #include <string> +#include "base/keyboard_codes.h" #include "chrome/test/automated_ui_tests/automated_ui_test_base.h" #include "chrome/test/ui/ui_test.h" @@ -293,7 +294,7 @@ class AutomatedUITest : public AutomatedUITestBase { // Calls SimulateOSKeyPress on the active window. Simulates a key press at // the OS level. |key| is the key pressed and |flags| specifies which // modifiers keys are also pressed (as defined in chrome/views/event.h). - bool SimulateKeyPressInActiveWindow(wchar_t key, int flags); + bool SimulateKeyPressInActiveWindow(base::KeyboardCode key, int flags); // Opens init file, reads it into the reader, and closes the file. // Returns false if there are any errors. diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index e7016cf..89f90ff 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -415,10 +415,10 @@ IPC_BEGIN_MESSAGES(Automation) // This message requests that a key press be performed. // Request: // int - the handle of the window that's the context for this click - // wchar_t - char of the key that was pressed. + // int - the base::KeyboardCode of the key that was pressed. // int - the flags which identify the modifiers (shift, ctrl, alt) // associated for, as defined in chrome/views/event.h - IPC_MESSAGE_ROUTED3(AutomationMsg_WindowKeyPress, int, wchar_t, int) + IPC_MESSAGE_ROUTED3(AutomationMsg_WindowKeyPress, int, int, int) // This message notifies the AutomationProvider to create a tab which is // hosted by an external process. diff --git a/chrome/test/automation/window_proxy.cc b/chrome/test/automation/window_proxy.cc index 5766259..5b08842 100644 --- a/chrome/test/automation/window_proxy.cc +++ b/chrome/test/automation/window_proxy.cc @@ -34,7 +34,7 @@ bool WindowProxy::GetWindowTitle(string16* text) { return sender_->Send(new AutomationMsg_WindowTitle(0, handle_, text)); } -bool WindowProxy::SimulateOSKeyPress(wchar_t key, int flags) { +bool WindowProxy::SimulateOSKeyPress(base::KeyboardCode key, int flags) { if (!is_valid()) return false; return sender_->Send( diff --git a/chrome/test/automation/window_proxy.h b/chrome/test/automation/window_proxy.h index 539ac20..33a27c0 100644 --- a/chrome/test/automation/window_proxy.h +++ b/chrome/test/automation/window_proxy.h @@ -13,6 +13,7 @@ #include <string> +#include "base/keyboard_codes.h" #include "base/string16.h" #include "base/thread.h" #include "chrome/test/automation/automation_handle_tracker.h" @@ -46,11 +47,11 @@ class WindowProxy : public AutomationResourceProxy { // Get the title of the top level window. bool GetWindowTitle(string16* text); - // Simulates a key press at the OS level. |key| is the key pressed and - // |flags| specifies which modifiers keys are also pressed (as defined in - // chrome/views/event.h). Note that this actually sends the event to the - // window that has focus. - bool SimulateOSKeyPress(wchar_t key, int flags); + // Simulates a key press at the OS level. |key| is the virtual key code of the + // key pressed and |flags| specifies which modifiers keys are also pressed (as + // defined in chrome/views/event.h). Note that this actually sends the event + // to the window that has focus. + bool SimulateOSKeyPress(base::KeyboardCode key, int flags); // Shows/hides the window and as a result makes it active/inactive. // Returns true if the call was successful. diff --git a/chrome/test/interactive_ui/npapi_interactive_test.cc b/chrome/test/interactive_ui/npapi_interactive_test.cc index 49271a6..9610f39 100644 --- a/chrome/test/interactive_ui/npapi_interactive_test.cc +++ b/chrome/test/interactive_ui/npapi_interactive_test.cc @@ -32,6 +32,7 @@ // #include "base/file_util.h" +#include "base/keyboard_codes.h" #include "chrome/browser/net/url_request_mock_http_job.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/automation/tab_proxy.h" @@ -92,7 +93,7 @@ TEST_F(NPAPIVisiblePluginTester, GetURLRequest404Response) { automation()->WaitForAppModalDialog(action_max_timeout_ms()); scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); ASSERT_TRUE(window.get()); - ASSERT_TRUE(window->SimulateOSKeyPress(VK_ESCAPE, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0)); WaitForFinish("geturl_404_response", "1", url, kTestCompleteCookie, kTestCompleteSuccess, kShortWaitTimeout); diff --git a/chrome/test/ui/npapi_uitest.cc b/chrome/test/ui/npapi_uitest.cc index 32139fa..ab43ca9 100644 --- a/chrome/test/ui/npapi_uitest.cc +++ b/chrome/test/ui/npapi_uitest.cc @@ -16,6 +16,7 @@ #include <ostream> #include "base/file_util.h" +#include "base/keyboard_codes.h" #include "chrome/browser/net/url_request_mock_http_job.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/automation/tab_proxy.h" @@ -138,7 +139,7 @@ TEST_F(NPAPITester, DISABLED_SelfDeletePluginInvokeAlert) { automation()->WaitForAppModalDialog(5000); scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); ASSERT_TRUE(window.get()); - ASSERT_TRUE(window->SimulateOSKeyPress(VK_ESCAPE, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0)); WaitForFinish("self_delete_plugin_invoke_alert", "1", url, kTestCompleteCookie, kTestCompleteSuccess, |