diff options
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_tests.cc | 20 | ||||
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_tests.h | 4 | ||||
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 2 | ||||
-rw-r--r-- | chrome/test/automation/window_proxy.cc | 2 | ||||
-rw-r--r-- | chrome/test/automation/window_proxy.h | 4 | ||||
-rw-r--r-- | chrome/test/interactive_ui/keyboard_access_uitest.cc | 20 | ||||
-rw-r--r-- | chrome/test/interactive_ui/npapi_interactive_test.cc | 6 | ||||
-rw-r--r-- | chrome/test/reliability/page_load_test.cc | 6 | ||||
-rw-r--r-- | chrome/test/render_view_test.cc | 6 | ||||
-rw-r--r-- | chrome/test/ui_test_utils.cc | 2 | ||||
-rw-r--r-- | chrome/test/ui_test_utils.h | 4 | ||||
-rw-r--r-- | chrome/test/webdriver/keymap.cc | 184 | ||||
-rw-r--r-- | chrome/test/webdriver/keymap.h | 10 |
13 files changed, 135 insertions, 135 deletions
diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index 759c84c7..1aad575 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -6,10 +6,10 @@ #include <string> #include <vector> -#include "app/keyboard_codes.h" #include "base/command_line.h" #include "base/environment.h" #include "base/file_util.h" +#include "base/keyboard_codes.h" #include "base/logging.h" #include "base/path_service.h" #include "base/rand_util.h" @@ -486,35 +486,35 @@ bool AutomatedUITest::Options() { } bool AutomatedUITest::PressDownArrow() { - return SimulateKeyPressInActiveWindow(app::VKEY_DOWN, 0); + return SimulateKeyPressInActiveWindow(base::VKEY_DOWN, 0); } bool AutomatedUITest::PressEnterKey() { - return SimulateKeyPressInActiveWindow(app::VKEY_RETURN, 0); + return SimulateKeyPressInActiveWindow(base::VKEY_RETURN, 0); } bool AutomatedUITest::PressEscapeKey() { - return SimulateKeyPressInActiveWindow(app::VKEY_ESCAPE, 0); + return SimulateKeyPressInActiveWindow(base::VKEY_ESCAPE, 0); } bool AutomatedUITest::PressPageDown() { - return SimulateKeyPressInActiveWindow(app::VKEY_PRIOR, 0); + return SimulateKeyPressInActiveWindow(base::VKEY_PRIOR, 0); } bool AutomatedUITest::PressPageUp() { - return SimulateKeyPressInActiveWindow(app::VKEY_NEXT, 0); + return SimulateKeyPressInActiveWindow(base::VKEY_NEXT, 0); } bool AutomatedUITest::PressSpaceBar() { - return SimulateKeyPressInActiveWindow(app::VKEY_SPACE, 0); + return SimulateKeyPressInActiveWindow(base::VKEY_SPACE, 0); } bool AutomatedUITest::PressTabKey() { - return SimulateKeyPressInActiveWindow(app::VKEY_TAB, 0); + return SimulateKeyPressInActiveWindow(base::VKEY_TAB, 0); } bool AutomatedUITest::PressUpArrow() { - return SimulateKeyPressInActiveWindow(app::VKEY_UP, 0); + return SimulateKeyPressInActiveWindow(base::VKEY_UP, 0); } bool AutomatedUITest::StarPage() { @@ -604,7 +604,7 @@ bool AutomatedUITest::ForceCrash() { return true; } -bool AutomatedUITest::SimulateKeyPressInActiveWindow(app::KeyboardCode key, +bool AutomatedUITest::SimulateKeyPressInActiveWindow(base::KeyboardCode key, int flags) { scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); if (window.get() == NULL) { diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.h b/chrome/test/automated_ui_tests/automated_ui_tests.h index ef7b1f3..d26675c 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.h +++ b/chrome/test/automated_ui_tests/automated_ui_tests.h @@ -103,7 +103,7 @@ #include <string> -#include "app/keyboard_codes.h" +#include "base/keyboard_codes.h" #include "chrome/test/automated_ui_tests/automated_ui_test_base.h" #include "chrome/test/ui/ui_test.h" @@ -295,7 +295,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(app::KeyboardCode 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 0ef68ad..b08529b 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -419,7 +419,7 @@ 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 - // int - the app::KeyboardCode 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, int, int) diff --git a/chrome/test/automation/window_proxy.cc b/chrome/test/automation/window_proxy.cc index 1a66edc..c098abd 100644 --- a/chrome/test/automation/window_proxy.cc +++ b/chrome/test/automation/window_proxy.cc @@ -41,7 +41,7 @@ bool WindowProxy::GetWindowTitle(string16* text) { return sender_->Send(new AutomationMsg_WindowTitle(0, handle_, text)); } -bool WindowProxy::SimulateOSKeyPress(app::KeyboardCode 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 f0a9ac5..cb7b022 100644 --- a/chrome/test/automation/window_proxy.h +++ b/chrome/test/automation/window_proxy.h @@ -12,7 +12,7 @@ #include <windows.h> #endif -#include "app/keyboard_codes.h" +#include "base/keyboard_codes.h" #include "base/string16.h" #include "base/thread.h" #include "chrome/test/automation/automation_handle_tracker.h" @@ -54,7 +54,7 @@ class WindowProxy : public AutomationResourceProxy { // 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(app::KeyboardCode key, int flags); + 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/keyboard_access_uitest.cc b/chrome/test/interactive_ui/keyboard_access_uitest.cc index d002a3e..2fdd3e8 100644 --- a/chrome/test/interactive_ui/keyboard_access_uitest.cc +++ b/chrome/test/interactive_ui/keyboard_access_uitest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/keyboard_codes.h" +#include "base/keyboard_codes.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" @@ -59,12 +59,12 @@ void KeyboardAccessTest::TestMenuKeyboardAccess(bool alternate_key_sequence) { int original_view_id = -1; ASSERT_TRUE(window->GetFocusedViewID(&original_view_id)); - app::KeyboardCode menu_key = - alternate_key_sequence ? app::VKEY_MENU : app::VKEY_F10; + base::KeyboardCode menu_key = + alternate_key_sequence ? base::VKEY_MENU : base::VKEY_F10; #if defined(OS_CHROMEOS) // Chrome OS has different function key accelerators, so we always use the // menu key there. - menu_key = app::VKEY_MENU; + menu_key = base::VKEY_MENU; #endif ASSERT_TRUE(window->SimulateOSKeyPress(menu_key, 0)); @@ -75,16 +75,16 @@ void KeyboardAccessTest::TestMenuKeyboardAccess(bool alternate_key_sequence) { ASSERT_TRUE(browser->StartTrackingPopupMenus()); if (alternate_key_sequence) - ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_DOWN, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_DOWN, 0)); else - ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_RETURN, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_RETURN, 0)); // Wait until the popup menu actually opens. ASSERT_TRUE(browser->WaitForPopupMenuToOpen()); // Press DOWN to select the first item, then RETURN to select it. - ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_DOWN, 0)); - ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_RETURN, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_DOWN, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_RETURN, 0)); // Wait for the new tab to appear. ASSERT_TRUE(browser->WaitForTabCountToBecome(2, action_timeout_ms())); @@ -125,13 +125,13 @@ TEST_F(KeyboardAccessTest, FAILS_ReserveKeyboardAccelerators) { scoped_refptr<WindowProxy> window(browser->GetWindow()); ASSERT_TRUE(window); ASSERT_TRUE(window->SimulateOSKeyPress( - app::VKEY_TAB, views::Event::EF_CONTROL_DOWN)); + base::VKEY_TAB, views::Event::EF_CONTROL_DOWN)); ASSERT_TRUE(browser->WaitForTabToBecomeActive(0, action_max_timeout_ms())); #if !defined(OS_MACOSX) // see BrowserWindowCocoa::GetCommandId ASSERT_TRUE(browser->ActivateTab(1)); ASSERT_TRUE(window->SimulateOSKeyPress( - app::VKEY_F4, views::Event::EF_CONTROL_DOWN)); + base::VKEY_F4, views::Event::EF_CONTROL_DOWN)); ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_max_timeout_ms())); #endif } diff --git a/chrome/test/interactive_ui/npapi_interactive_test.cc b/chrome/test/interactive_ui/npapi_interactive_test.cc index 7a867d2..7965151 100644 --- a/chrome/test/interactive_ui/npapi_interactive_test.cc +++ b/chrome/test/interactive_ui/npapi_interactive_test.cc @@ -31,8 +31,8 @@ // NPAPI interactive UI tests. // -#include "app/keyboard_codes.h" #include "base/file_path.h" +#include "base/keyboard_codes.h" #include "chrome/browser/net/url_request_mock_http_job.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" @@ -95,7 +95,7 @@ TEST_F(NPAPIVisiblePluginTester, GetURLRequest404Response) { automation()->WaitForAppModalDialog(); scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); ASSERT_TRUE(window.get()); - ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_ESCAPE, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0)); WaitForFinish("geturl_404_response", "1", url, kTestCompleteCookie, kTestCompleteSuccess, action_max_timeout_ms()); @@ -114,7 +114,7 @@ TEST_F(NPAPIVisiblePluginTester, DISABLED_SelfDeletePluginInvokeAlert) { ASSERT_TRUE(automation()->WaitForAppModalDialog()); scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); ASSERT_TRUE(window.get()); - ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_ESCAPE, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0)); WaitForFinish("self_delete_plugin_invoke_alert", "1", url, kTestCompleteCookie, kTestCompleteSuccess, diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index 6289b56..a903032 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -36,11 +36,11 @@ #include <fstream> -#include "app/keyboard_codes.h" #include "base/command_line.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/file_version_info.h" +#include "base/keyboard_codes.h" #include "base/i18n/time_formatting.h" #include "base/path_service.h" #include "base/string_number_conversions.h" @@ -209,9 +209,9 @@ class PageLoadTest : public UITest { scoped_refptr<WindowProxy> window(browser->GetWindow()); if (window.get()) { if (browser->BringToFront()) { - window->SimulateOSKeyPress(app::VKEY_NEXT, 0); + window->SimulateOSKeyPress(base::VKEY_NEXT, 0); PlatformThread::Sleep(sleep_timeout_ms()); - window->SimulateOSKeyPress(app::VKEY_NEXT, 0); + window->SimulateOSKeyPress(base::VKEY_NEXT, 0); PlatformThread::Sleep(sleep_timeout_ms()); } } diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc index 848f440..9094525 100644 --- a/chrome/test/render_view_test.cc +++ b/chrome/test/render_view_test.cc @@ -26,7 +26,7 @@ #include "webkit/glue/webkit_glue.h" #if defined(OS_LINUX) -#include "app/event_synthesis_gtk.h" +#include "base/event_synthesis_gtk.h" #endif using WebKit::WebFrame; @@ -188,8 +188,8 @@ int RenderViewTest::SendKeyEvent(MockKeyboard::Layout layout, // We ignore |layout|, which means we are only testing the layout of the // current locale. TODO(estade): fix this to respect |layout|. std::vector<GdkEvent*> events; - app::SynthesizeKeyPressEvents( - NULL, static_cast<app::KeyboardCode>(key_code), + base::SynthesizeKeyPressEvents( + NULL, static_cast<base::KeyboardCode>(key_code), modifiers & (MockKeyboard::LEFT_CONTROL | MockKeyboard::RIGHT_CONTROL), modifiers & (MockKeyboard::LEFT_SHIFT | MockKeyboard::RIGHT_SHIFT), modifiers & (MockKeyboard::LEFT_ALT | MockKeyboard::RIGHT_ALT), diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index ad0d3a7..9c86038 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -551,7 +551,7 @@ void WaitForBookmarkModelToLoad(BookmarkModel* model) { } bool SendKeyPressSync(gfx::NativeWindow window, - app::KeyboardCode key, + base::KeyboardCode key, bool control, bool shift, bool alt, diff --git a/chrome/test/ui_test_utils.h b/chrome/test/ui_test_utils.h index 28552d8..8ca8b02 100644 --- a/chrome/test/ui_test_utils.h +++ b/chrome/test/ui_test_utils.h @@ -10,8 +10,8 @@ #include <string> #include <set> -#include "app/keyboard_codes.h" #include "base/basictypes.h" +#include "base/keyboard_codes.h" #include "base/message_loop.h" #include "base/scoped_temp_dir.h" #include "base/string16.h" @@ -193,7 +193,7 @@ void WaitForBookmarkModelToLoad(BookmarkModel* model); // out. This uses ui_controls::SendKeyPress, see it for details. Returns true // if the event was successfully sent and received. bool SendKeyPressSync(gfx::NativeWindow window, - app::KeyboardCode key, + base::KeyboardCode key, bool control, bool shift, bool alt, diff --git a/chrome/test/webdriver/keymap.cc b/chrome/test/webdriver/keymap.cc index 640bf45..6c3eac6 100644 --- a/chrome/test/webdriver/keymap.cc +++ b/chrome/test/webdriver/keymap.cc @@ -14,132 +14,132 @@ KeyMap::KeyMap() { // 0xE000-0xF8FF. // Special WebDriver NULL key; clears all modifiers. - keys_[L'\uE000'] = app::VKEY_UNKNOWN; - - keys_[L'\uE001'] = app::VKEY_UNKNOWN; // TODO(jmikhail): CANCEL - keys_[L'\uE002'] = app::VKEY_HELP; - keys_[L'\uE003'] = app::VKEY_BACK; // BACKSPACE - keys_[L'\uE004'] = app::VKEY_TAB; - keys_[L'\uE005'] = app::VKEY_CLEAR; - keys_[L'\uE006'] = app::VKEY_RETURN; - keys_[L'\uE007'] = app::VKEY_UNKNOWN; // TODO(jmikhail): ENTER - keys_[L'\uE008'] = app::VKEY_SHIFT; - keys_[L'\uE009'] = app::VKEY_CONTROL; - keys_[L'\uE00A'] = app::VKEY_MENU; // ALT - keys_[L'\uE00B'] = app::VKEY_PAUSE; - keys_[L'\uE00C'] = app::VKEY_ESCAPE; - keys_[L'\uE00D'] = app::VKEY_SPACE; - keys_[L'\uE00E'] = app::VKEY_PRIOR; // PAGEUP - keys_[L'\uE00F'] = app::VKEY_NEXT; // PAGEDOWN - keys_[L'\uE010'] = app::VKEY_END; - keys_[L'\uE011'] = app::VKEY_HOME; - keys_[L'\uE012'] = app::VKEY_LEFT; - keys_[L'\uE013'] = app::VKEY_UP; - keys_[L'\uE014'] = app::VKEY_RIGHT; - keys_[L'\uE015'] = app::VKEY_DOWN; - keys_[L'\uE016'] = app::VKEY_INSERT; - keys_[L'\uE017'] = app::VKEY_DELETE; - - keys_[L'\uE01A'] = app::VKEY_NUMPAD0; - keys_[L'\uE01B'] = app::VKEY_NUMPAD1; - keys_[L'\uE01C'] = app::VKEY_NUMPAD2; - keys_[L'\uE01D'] = app::VKEY_NUMPAD3; - keys_[L'\uE01E'] = app::VKEY_NUMPAD4; - keys_[L'\uE01F'] = app::VKEY_NUMPAD5; - keys_[L'\uE020'] = app::VKEY_NUMPAD6; - keys_[L'\uE021'] = app::VKEY_NUMPAD7; - keys_[L'\uE022'] = app::VKEY_NUMPAD8; - keys_[L'\uE023'] = app::VKEY_NUMPAD9; - keys_[L'\uE024'] = app::VKEY_MULTIPLY; - keys_[L'\uE025'] = app::VKEY_ADD; - keys_[L'\uE026'] = app::VKEY_SEPARATOR; - keys_[L'\uE027'] = app::VKEY_SUBTRACT; - keys_[L'\uE028'] = app::VKEY_DECIMAL; - keys_[L'\uE029'] = app::VKEY_DIVIDE; - - keys_[L'\uE031'] = app::VKEY_F1; - keys_[L'\uE032'] = app::VKEY_F2; - keys_[L'\uE033'] = app::VKEY_F3; - keys_[L'\uE034'] = app::VKEY_F4; - keys_[L'\uE035'] = app::VKEY_F5; - keys_[L'\uE036'] = app::VKEY_F6; - keys_[L'\uE037'] = app::VKEY_F7; - keys_[L'\uE038'] = app::VKEY_F8; - keys_[L'\uE039'] = app::VKEY_F9; - keys_[L'\uE03A'] = app::VKEY_F10; - keys_[L'\uE03B'] = app::VKEY_F11; - keys_[L'\uE03C'] = app::VKEY_F12; + keys_[L'\uE000'] = base::VKEY_UNKNOWN; + + keys_[L'\uE001'] = base::VKEY_UNKNOWN; // TODO(jmikhail): CANCEL + keys_[L'\uE002'] = base::VKEY_HELP; + keys_[L'\uE003'] = base::VKEY_BACK; // BACKSPACE + keys_[L'\uE004'] = base::VKEY_TAB; + keys_[L'\uE005'] = base::VKEY_CLEAR; + keys_[L'\uE006'] = base::VKEY_RETURN; + keys_[L'\uE007'] = base::VKEY_UNKNOWN; // TODO(jmikhail): ENTER + keys_[L'\uE008'] = base::VKEY_SHIFT; + keys_[L'\uE009'] = base::VKEY_CONTROL; + keys_[L'\uE00A'] = base::VKEY_MENU; // ALT + keys_[L'\uE00B'] = base::VKEY_PAUSE; + keys_[L'\uE00C'] = base::VKEY_ESCAPE; + keys_[L'\uE00D'] = base::VKEY_SPACE; + keys_[L'\uE00E'] = base::VKEY_PRIOR; // PAGEUP + keys_[L'\uE00F'] = base::VKEY_NEXT; // PAGEDOWN + keys_[L'\uE010'] = base::VKEY_END; + keys_[L'\uE011'] = base::VKEY_HOME; + keys_[L'\uE012'] = base::VKEY_LEFT; + keys_[L'\uE013'] = base::VKEY_UP; + keys_[L'\uE014'] = base::VKEY_RIGHT; + keys_[L'\uE015'] = base::VKEY_DOWN; + keys_[L'\uE016'] = base::VKEY_INSERT; + keys_[L'\uE017'] = base::VKEY_DELETE; + + keys_[L'\uE01A'] = base::VKEY_NUMPAD0; + keys_[L'\uE01B'] = base::VKEY_NUMPAD1; + keys_[L'\uE01C'] = base::VKEY_NUMPAD2; + keys_[L'\uE01D'] = base::VKEY_NUMPAD3; + keys_[L'\uE01E'] = base::VKEY_NUMPAD4; + keys_[L'\uE01F'] = base::VKEY_NUMPAD5; + keys_[L'\uE020'] = base::VKEY_NUMPAD6; + keys_[L'\uE021'] = base::VKEY_NUMPAD7; + keys_[L'\uE022'] = base::VKEY_NUMPAD8; + keys_[L'\uE023'] = base::VKEY_NUMPAD9; + keys_[L'\uE024'] = base::VKEY_MULTIPLY; + keys_[L'\uE025'] = base::VKEY_ADD; + keys_[L'\uE026'] = base::VKEY_SEPARATOR; + keys_[L'\uE027'] = base::VKEY_SUBTRACT; + keys_[L'\uE028'] = base::VKEY_DECIMAL; + keys_[L'\uE029'] = base::VKEY_DIVIDE; + + keys_[L'\uE031'] = base::VKEY_F1; + keys_[L'\uE032'] = base::VKEY_F2; + keys_[L'\uE033'] = base::VKEY_F3; + keys_[L'\uE034'] = base::VKEY_F4; + keys_[L'\uE035'] = base::VKEY_F5; + keys_[L'\uE036'] = base::VKEY_F6; + keys_[L'\uE037'] = base::VKEY_F7; + keys_[L'\uE038'] = base::VKEY_F8; + keys_[L'\uE039'] = base::VKEY_F9; + keys_[L'\uE03A'] = base::VKEY_F10; + keys_[L'\uE03B'] = base::VKEY_F11; + keys_[L'\uE03C'] = base::VKEY_F12; // Common aliases. - keys_[L'\t'] = app::VKEY_TAB; - keys_[L'\n'] = app::VKEY_RETURN; - keys_[L'\r'] = app::VKEY_RETURN; - keys_[L'\b'] = app::VKEY_BACK; + keys_[L'\t'] = base::VKEY_TAB; + keys_[L'\n'] = base::VKEY_RETURN; + keys_[L'\r'] = base::VKEY_RETURN; + keys_[L'\b'] = base::VKEY_BACK; - keys_[L' '] = app::VKEY_SPACE; + keys_[L' '] = base::VKEY_SPACE; // Alpha keys match their ASCII values for (int i = 0; i < 26; ++i) { keys_[static_cast<wchar_t>(L'a' + i)] = \ - static_cast<app::KeyboardCode>(app::VKEY_A + i); + static_cast<base::KeyboardCode>(base::VKEY_A + i); shifted_keys_[static_cast<wchar_t>(L'A' + i)] = \ - static_cast<app::KeyboardCode>(app::VKEY_A + i); + static_cast<base::KeyboardCode>(base::VKEY_A + i); } // Numeric keys match their ASCII values for (int i = 0; i < 10; ++i) { keys_[static_cast<wchar_t>(L'0' + i)] = \ - static_cast<app::KeyboardCode>(app::VKEY_0 + i); + static_cast<base::KeyboardCode>(base::VKEY_0 + i); } // The following all assumes the standard US keyboard. // TODO(jmikhail): Lookup correct keycode based on the current system keyboard // layout. Right now it's fixed assuming standard ANSI - keys_[L'='] = shifted_keys_[L'+'] = app::VKEY_OEM_PLUS; - keys_[L'-'] = shifted_keys_[L'_'] = app::VKEY_OEM_MINUS; - keys_[L';'] = shifted_keys_[L':'] = app::VKEY_OEM_1; - keys_[L'/'] = shifted_keys_[L'?'] = app::VKEY_OEM_2; - keys_[L'`'] = shifted_keys_[L'~'] = app::VKEY_OEM_3; - keys_[L'['] = shifted_keys_[L'{'] = app::VKEY_OEM_4; - keys_[L'\\'] = shifted_keys_[L'|'] = app::VKEY_OEM_5; - keys_[L']'] = shifted_keys_[L'}'] = app::VKEY_OEM_6; - keys_[L'\''] = shifted_keys_[L'"'] = app::VKEY_OEM_7; - keys_[L','] = shifted_keys_[L'<'] = app::VKEY_OEM_COMMA; - keys_[L'.'] = shifted_keys_[L'>'] = app::VKEY_OEM_PERIOD; - shifted_keys_[L'!'] = app::VKEY_1; - shifted_keys_[L'@'] = app::VKEY_2; - shifted_keys_[L'#'] = app::VKEY_3; - shifted_keys_[L'$'] = app::VKEY_4; - shifted_keys_[L'%'] = app::VKEY_5; - shifted_keys_[L'^'] = app::VKEY_6; - shifted_keys_[L'&'] = app::VKEY_7; - shifted_keys_[L'*'] = app::VKEY_8; - shifted_keys_[L'('] = app::VKEY_9; - shifted_keys_[L')'] = app::VKEY_0; + keys_[L'='] = shifted_keys_[L'+'] = base::VKEY_OEM_PLUS; + keys_[L'-'] = shifted_keys_[L'_'] = base::VKEY_OEM_MINUS; + keys_[L';'] = shifted_keys_[L':'] = base::VKEY_OEM_1; + keys_[L'/'] = shifted_keys_[L'?'] = base::VKEY_OEM_2; + keys_[L'`'] = shifted_keys_[L'~'] = base::VKEY_OEM_3; + keys_[L'['] = shifted_keys_[L'{'] = base::VKEY_OEM_4; + keys_[L'\\'] = shifted_keys_[L'|'] = base::VKEY_OEM_5; + keys_[L']'] = shifted_keys_[L'}'] = base::VKEY_OEM_6; + keys_[L'\''] = shifted_keys_[L'"'] = base::VKEY_OEM_7; + keys_[L','] = shifted_keys_[L'<'] = base::VKEY_OEM_COMMA; + keys_[L'.'] = shifted_keys_[L'>'] = base::VKEY_OEM_PERIOD; + shifted_keys_[L'!'] = base::VKEY_1; + shifted_keys_[L'@'] = base::VKEY_2; + shifted_keys_[L'#'] = base::VKEY_3; + shifted_keys_[L'$'] = base::VKEY_4; + shifted_keys_[L'%'] = base::VKEY_5; + shifted_keys_[L'^'] = base::VKEY_6; + shifted_keys_[L'&'] = base::VKEY_7; + shifted_keys_[L'*'] = base::VKEY_8; + shifted_keys_[L'('] = base::VKEY_9; + shifted_keys_[L')'] = base::VKEY_0; } -app::KeyboardCode KeyMap::Get(const wchar_t& key) const { - std::map<wchar_t, app::KeyboardCode>::const_iterator it; +base::KeyboardCode KeyMap::Get(const wchar_t& key) const { + std::map<wchar_t, base::KeyboardCode>::const_iterator it; it = keys_.find(key); if (it == keys_.end()) { it = shifted_keys_.find(key); if (it == shifted_keys_.end()) { - return app::VKEY_UNKNOWN; + return base::VKEY_UNKNOWN; } } return it->second; } bool KeyMap::Press(const scoped_refptr<WindowProxy>& window, - const app::KeyboardCode key_code, + const base::KeyboardCode key_code, const wchar_t& key) { - if (key_code == app::VKEY_SHIFT) { + if (key_code == base::VKEY_SHIFT) { shift_ = !shift_; - } else if (key_code == app::VKEY_CONTROL) { + } else if (key_code == base::VKEY_CONTROL) { control_ = !control_; - } else if (key_code == app::VKEY_MENU) { // ALT + } else if (key_code == base::VKEY_MENU) { // ALT alt_ = !alt_; - } else if (key_code == app::VKEY_COMMAND) { + } else if (key_code == base::VKEY_COMMAND) { command_ = !command_; } diff --git a/chrome/test/webdriver/keymap.h b/chrome/test/webdriver/keymap.h index e4b1594..688ffa7 100644 --- a/chrome/test/webdriver/keymap.h +++ b/chrome/test/webdriver/keymap.h @@ -7,7 +7,7 @@ #include <map> -#include "app/keyboard_codes.h" +#include "base/keyboard_codes.h" #include "chrome/test/automation/window_proxy.h" namespace webdriver { @@ -16,10 +16,10 @@ namespace webdriver { class KeyMap { public: KeyMap(); - app::KeyboardCode Get(const wchar_t& key) const; + base::KeyboardCode Get(const wchar_t& key) const; bool Press(const scoped_refptr<WindowProxy>& window, - const app::KeyboardCode key_code, + const base::KeyboardCode key_code, const wchar_t& key); // Sets the Shift, Alt, Cntl, and Cmd keys to not pressed @@ -30,8 +30,8 @@ class KeyMap { bool alt_; bool control_; bool command_; - std::map<wchar_t, app::KeyboardCode> keys_; - std::map<wchar_t, app::KeyboardCode> shifted_keys_; + std::map<wchar_t, base::KeyboardCode> keys_; + std::map<wchar_t, base::KeyboardCode> shifted_keys_; DISALLOW_COPY_AND_ASSIGN(KeyMap); }; } // namespace webdriver |