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

Side by Side Diff: chrome/test/webdriver/webdriver_automation.cc

Issue 11818029: [chromedriver] Remove support for simulating OS-level key events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 11 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/test/webdriver/webdriver_automation.h" 5 #include "chrome/test/webdriver/webdriver_automation.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 if (*error) 696 if (*error)
697 return; 697 return;
698 698
699 automation::Error auto_error; 699 automation::Error auto_error;
700 if (!SendWebKeyEventJSONRequest( 700 if (!SendWebKeyEventJSONRequest(
701 automation(), view_locator, key_event, &auto_error)) { 701 automation(), view_locator, key_event, &auto_error)) {
702 *error = Error::FromAutomationError(auto_error); 702 *error = Error::FromAutomationError(auto_error);
703 } 703 }
704 } 704 }
705 705
706 void Automation::SendNativeKeyEvent(const WebViewId& view_id,
707 ui::KeyboardCode key_code,
708 int modifiers,
709 Error** error) {
710 WebViewLocator view_locator;
711 *error = ConvertViewIdToLocator(view_id, &view_locator);
712 if (*error)
713 return;
714
715 automation::Error auto_error;
716 if (!SendNativeKeyEventJSONRequest(
717 automation(), view_locator, key_code, modifiers, &auto_error)) {
718 *error = Error::FromAutomationError(auto_error);
719 }
720 }
721
722 void Automation::SendWebMouseEvent(const WebViewId& view_id, 706 void Automation::SendWebMouseEvent(const WebViewId& view_id,
723 const WebMouseEvent& event, 707 const WebMouseEvent& event,
724 Error** error) { 708 Error** error) {
725 WebViewLocator view_locator; 709 WebViewLocator view_locator;
726 *error = ConvertViewIdToLocator(view_id, &view_locator); 710 *error = ConvertViewIdToLocator(view_id, &view_locator);
727 if (*error) 711 if (*error)
728 return; 712 return;
729 713
730 automation::Error auto_error; 714 automation::Error auto_error;
731 if (!SendWebMouseEventJSONRequest( 715 if (!SendWebMouseEventJSONRequest(
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 } 1204 }
1221 1205
1222 Error* Automation::CheckMaximizeSupported() { 1206 Error* Automation::CheckMaximizeSupported() {
1223 const char* message = 1207 const char* message =
1224 "Maximize automation interface is not supported for this version of " 1208 "Maximize automation interface is not supported for this version of "
1225 "Chrome."; 1209 "Chrome.";
1226 return CheckVersion(1160, message); 1210 return CheckVersion(1160, message);
1227 } 1211 }
1228 1212
1229 } // namespace webdriver 1213 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/webdriver_automation.h ('k') | chrome/test/webdriver/webdriver_capabilities_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698