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

Side by Side Diff: chrome/test/automation/automation_json_requests.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/automation/automation_json_requests.h" 5 #include "chrome/test/automation/automation_json_requests.h"
6 6
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 dict.SetInteger("nativeKeyCode", key_event.key_code); 382 dict.SetInteger("nativeKeyCode", key_event.key_code);
383 dict.SetInteger("windowsKeyCode", key_event.key_code); 383 dict.SetInteger("windowsKeyCode", key_event.key_code);
384 dict.SetString("unmodifiedText", key_event.unmodified_text); 384 dict.SetString("unmodifiedText", key_event.unmodified_text);
385 dict.SetString("text", key_event.modified_text); 385 dict.SetString("text", key_event.modified_text);
386 dict.SetInteger("modifiers", key_event.modifiers); 386 dict.SetInteger("modifiers", key_event.modifiers);
387 dict.SetBoolean("isSystemKey", false); 387 dict.SetBoolean("isSystemKey", false);
388 DictionaryValue reply_dict; 388 DictionaryValue reply_dict;
389 return SendAutomationJSONRequest(sender, dict, &reply_dict); 389 return SendAutomationJSONRequest(sender, dict, &reply_dict);
390 } 390 }
391 391
392 bool SendNativeKeyEventJSONRequest(
393 AutomationMessageSender* sender,
394 int browser_index,
395 int tab_index,
396 ui::KeyboardCode key_code,
397 int modifiers) {
398 DictionaryValue dict;
399 dict.SetString("command", "SendOSLevelKeyEvent");
400 dict.SetInteger("windex", browser_index);
401 dict.SetInteger("tab_index", tab_index);
402 dict.SetInteger("nativeKeyCode", key_code);
403 dict.SetInteger("modifiers", modifiers);
404 DictionaryValue reply_dict;
405 return SendAutomationJSONRequest(sender, dict, &reply_dict);
406 }
407
392 bool SendWaitForAllTabsToStopLoadingJSONRequest( 408 bool SendWaitForAllTabsToStopLoadingJSONRequest(
393 AutomationMessageSender* sender) { 409 AutomationMessageSender* sender) {
394 DictionaryValue dict; 410 DictionaryValue dict;
395 dict.SetString("command", "WaitForAllTabsToStopLoading"); 411 dict.SetString("command", "WaitForAllTabsToStopLoading");
396 DictionaryValue reply_dict; 412 DictionaryValue reply_dict;
397 return SendAutomationJSONRequest(sender, dict, &reply_dict); 413 return SendAutomationJSONRequest(sender, dict, &reply_dict);
398 } 414 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698