Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: chrome/test/webdriver/keymap.h

Issue 6462015: Cleanup more test code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wtf windows is this me Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_TEST_WEBDRIVER_KEYMAP_H_ 5 #ifndef CHROME_TEST_WEBDRIVER_KEYMAP_H_
6 #define CHROME_TEST_WEBDRIVER_KEYMAP_H_ 6 #define CHROME_TEST_WEBDRIVER_KEYMAP_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "chrome/test/automation/window_proxy.h" 10 #include "chrome/test/automation/window_proxy.h"
11 #include "ui/base/keycodes/keyboard_codes.h" 11 #include "ui/base/keycodes/keyboard_codes.h"
12 12
13 namespace webdriver { 13 namespace webdriver {
14 14
15 // Maps the key space used by WebDriver to Chrome for Linux/Mac/Windows. 15 // Maps the key space used by WebDriver to Chrome for Linux/Mac/Windows.
16 class KeyMap { 16 class KeyMap {
17 public: 17 public:
18 KeyMap(); 18 KeyMap();
19 ~KeyMap();
19 ui::KeyboardCode Get(const wchar_t& key) const; 20 ui::KeyboardCode Get(const wchar_t& key) const;
20 21
21 bool Press(const scoped_refptr<WindowProxy>& window, 22 bool Press(const scoped_refptr<WindowProxy>& window,
22 const ui::KeyboardCode key_code, 23 const ui::KeyboardCode key_code,
23 const wchar_t& key); 24 const wchar_t& key);
24 25
25 // Sets the Shift, Alt, Cntl, and Cmd keys to not pressed. 26 // Sets the Shift, Alt, Cntl, and Cmd keys to not pressed.
26 void ClearModifiers(); 27 void ClearModifiers();
27 28
28 private: 29 private:
29 bool shift_; 30 bool shift_;
30 bool alt_; 31 bool alt_;
31 bool control_; 32 bool control_;
32 bool command_; 33 bool command_;
33 std::map<wchar_t, ui::KeyboardCode> keys_; 34 std::map<wchar_t, ui::KeyboardCode> keys_;
34 std::map<wchar_t, ui::KeyboardCode> shifted_keys_; 35 std::map<wchar_t, ui::KeyboardCode> shifted_keys_;
35 DISALLOW_COPY_AND_ASSIGN(KeyMap); 36 DISALLOW_COPY_AND_ASSIGN(KeyMap);
36 }; 37 };
37 38
38 } // namespace webdriver 39 } // namespace webdriver
39 40
40 #endif // CHROME_TEST_WEBDRIVER_KEYMAP_H_ 41 #endif // CHROME_TEST_WEBDRIVER_KEYMAP_H_
41 42
OLDNEW
« no previous file with comments | « chrome/test/webdriver/commands/find_element_commands.cc ('k') | chrome/test/webdriver/keymap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698