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

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

Issue 6630001: Allow webdriver users to choose between sending the key events when... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 8 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
« no previous file with comments | « chrome/test/webdriver/automation.h ('k') | chrome/test/webdriver/chromedriver_tests.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 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 #include "chrome/test/webdriver/automation.h" 5 #include "chrome/test/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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 void Automation::SendWebKeyEvent(int tab_id, 222 void Automation::SendWebKeyEvent(int tab_id,
223 const WebKeyEvent& key_event, 223 const WebKeyEvent& key_event,
224 bool* success) { 224 bool* success) {
225 int windex = 0, tab_index = 0; 225 int windex = 0, tab_index = 0;
226 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { 226 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) {
227 *success = false; 227 *success = false;
228 return; 228 return;
229 } 229 }
230
231 *success = SendWebKeyEventJSONRequest( 230 *success = SendWebKeyEventJSONRequest(
232 automation(), windex, tab_index, key_event); 231 automation(), windex, tab_index, key_event);
233 } 232 }
234 233
234 void Automation::SendNativeKeyEvent(int tab_id,
235 ui::KeyboardCode key_code,
236 int modifiers,
237 bool* success) {
238 int windex = 0, tab_index = 0;
239 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) {
240 *success = false;
241 return;
242 }
243 *success = SendNativeKeyEventJSONRequest(
244 automation(), windex, tab_index, key_code, modifiers);
245 }
246
235 void Automation::CaptureEntirePageAsPNG(int tab_id, 247 void Automation::CaptureEntirePageAsPNG(int tab_id,
236 const FilePath& path, 248 const FilePath& path,
237 bool* success) { 249 bool* success) {
238 int windex = 0, tab_index = 0; 250 int windex = 0, tab_index = 0;
239 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { 251 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) {
240 *success = false; 252 *success = false;
241 return; 253 return;
242 } 254 }
243 255
244 *success = SendCaptureEntirePageJSONRequest( 256 *success = SendCaptureEntirePageJSONRequest(
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 int tab_id, int* browser_index, int* tab_index) { 440 int tab_id, int* browser_index, int* tab_index) {
429 if (!SendGetIndicesFromTabIdJSONRequest(automation(), tab_id, 441 if (!SendGetIndicesFromTabIdJSONRequest(automation(), tab_id,
430 browser_index, tab_index)) { 442 browser_index, tab_index)) {
431 LOG(ERROR) << "Could not get browser and tab indices for WebDriver tab id"; 443 LOG(ERROR) << "Could not get browser and tab indices for WebDriver tab id";
432 return false; 444 return false;
433 } 445 }
434 return true; 446 return true;
435 } 447 }
436 448
437 } // namespace webdriver 449 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/automation.h ('k') | chrome/test/webdriver/chromedriver_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698