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

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, 9 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) 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 *success = false; 212 *success = false;
213 return; 213 return;
214 } 214 }
215 215
216 *success = SendMouseDragJSONRequest( 216 *success = SendMouseDragJSONRequest(
217 automation(), windex, tab_index, start.x(), start.y(), end.x(), end.y()); 217 automation(), windex, tab_index, start.x(), start.y(), end.x(), end.y());
218 } 218 }
219 219
220 void Automation::SendWebKeyEvent(int tab_id, 220 void Automation::SendWebKeyEvent(int tab_id,
221 const WebKeyEvent& key_event, 221 const WebKeyEvent& key_event,
222 bool use_native_events,
222 bool* success) { 223 bool* success) {
223 int windex = 0, tab_index = 0; 224 int windex = 0, tab_index = 0;
224 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { 225 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) {
225 *success = false; 226 *success = false;
226 return; 227 return;
227 } 228 }
228 229
229 *success = SendWebKeyEventJSONRequest( 230 if (use_native_events) {
230 automation(), windex, tab_index, key_event); 231 *success = SendNativeWebKeyEventJSONRequest(
232 automation(), windex, tab_index, key_event);
233 } else {
234 *success = SendWebKeyEventJSONRequest(
235 automation(), windex, tab_index, key_event);
236 }
231 } 237 }
232 238
233 void Automation::NavigateToURL(int tab_id, 239 void Automation::NavigateToURL(int tab_id,
234 const std::string& url, 240 const std::string& url,
235 bool* success) { 241 bool* success) {
236 int browser_index = 0, tab_index = 0; 242 int browser_index = 0, tab_index = 0;
237 if (!GetIndicesForTab(tab_id, &browser_index, &tab_index)) { 243 if (!GetIndicesForTab(tab_id, &browser_index, &tab_index)) {
238 *success = false; 244 *success = false;
239 return; 245 return;
240 } 246 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 int tab_id, int* browser_index, int* tab_index) { 401 int tab_id, int* browser_index, int* tab_index) {
396 if (!SendGetIndicesFromTabIdJSONRequest(automation(), tab_id, 402 if (!SendGetIndicesFromTabIdJSONRequest(automation(), tab_id,
397 browser_index, tab_index)) { 403 browser_index, tab_index)) {
398 LOG(ERROR) << "Could not get browser and tab indices for WebDriver tab id"; 404 LOG(ERROR) << "Could not get browser and tab indices for WebDriver tab id";
399 return false; 405 return false;
400 } 406 }
401 return true; 407 return true;
402 } 408 }
403 409
404 } // namespace webdriver 410 } // namespace webdriver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698