| OLD | NEW |
| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 if (*error) | 334 if (*error) |
| 335 return; | 335 return; |
| 336 | 336 |
| 337 std::string error_msg; | 337 std::string error_msg; |
| 338 if (!SendMouseDoubleClickJSONRequest( | 338 if (!SendMouseDoubleClickJSONRequest( |
| 339 automation(), windex, tab_index, p.x(), p.y(), &error_msg)) { | 339 automation(), windex, tab_index, p.x(), p.y(), &error_msg)) { |
| 340 *error = new Error(kUnknownError, error_msg); | 340 *error = new Error(kUnknownError, error_msg); |
| 341 } | 341 } |
| 342 } | 342 } |
| 343 | 343 |
| 344 void Automation::DragAndDropFilePaths( |
| 345 int tab_id, const gfx::Point& location, |
| 346 const std::vector<std::string>& paths, Error** error) { |
| 347 int windex = 0, tab_index = 0; |
| 348 *error = GetIndicesForTab(tab_id, &windex, &tab_index); |
| 349 if (*error) { |
| 350 return; |
| 351 } |
| 352 |
| 353 std::string error_msg; |
| 354 if (!SendDragAndDropFilePathsJSONRequest( |
| 355 automation(), windex, tab_index, location.x(), location.y(), paths, |
| 356 &error_msg)) { |
| 357 *error = new Error(kUnknownError, error_msg); |
| 358 } |
| 359 } |
| 360 |
| 344 void Automation::SendWebKeyEvent(int tab_id, | 361 void Automation::SendWebKeyEvent(int tab_id, |
| 345 const WebKeyEvent& key_event, | 362 const WebKeyEvent& key_event, |
| 346 Error** error) { | 363 Error** error) { |
| 347 int windex = 0, tab_index = 0; | 364 int windex = 0, tab_index = 0; |
| 348 *error = GetIndicesForTab(tab_id, &windex, &tab_index); | 365 *error = GetIndicesForTab(tab_id, &windex, &tab_index); |
| 349 if (*error) | 366 if (*error) |
| 350 return; | 367 return; |
| 351 | 368 |
| 352 std::string error_msg; | 369 std::string error_msg; |
| 353 if (!SendWebKeyEventJSONRequest( | 370 if (!SendWebKeyEventJSONRequest( |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 768, 0, "Alerts are not supported for this version of Chrome"); | 673 768, 0, "Alerts are not supported for this version of Chrome"); |
| 657 } | 674 } |
| 658 | 675 |
| 659 Error* Automation::CheckAdvancedInteractionsSupported() { | 676 Error* Automation::CheckAdvancedInteractionsSupported() { |
| 660 const char* message = | 677 const char* message = |
| 661 "Advanced user interactions are not supported for this version of Chrome"; | 678 "Advanced user interactions are not supported for this version of Chrome"; |
| 662 return CheckVersion(750, 0, message); | 679 return CheckVersion(750, 0, message); |
| 663 } | 680 } |
| 664 | 681 |
| 665 } // namespace webdriver | 682 } // namespace webdriver |
| OLD | NEW |