| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 if (*error) | 321 if (*error) |
| 322 return; | 322 return; |
| 323 | 323 |
| 324 std::string error_msg; | 324 std::string error_msg; |
| 325 if (!SendMouseDoubleClickJSONRequest( | 325 if (!SendMouseDoubleClickJSONRequest( |
| 326 automation(), windex, tab_index, p.x(), p.y(), &error_msg)) { | 326 automation(), windex, tab_index, p.x(), p.y(), &error_msg)) { |
| 327 *error = CreateChromeError(error_msg); | 327 *error = CreateChromeError(error_msg); |
| 328 } | 328 } |
| 329 } | 329 } |
| 330 | 330 |
| 331 void Automation::DragAndDropFilePaths( |
| 332 int tab_id, const gfx::Point& location, |
| 333 const std::vector<std::string>& paths, Error** error) { |
| 334 int windex = 0, tab_index = 0; |
| 335 *error = GetIndicesForTab(tab_id, &windex, &tab_index); |
| 336 if (*error) { |
| 337 return; |
| 338 } |
| 339 |
| 340 std::string error_msg; |
| 341 if (!SendDragAndDropFilePathsJSONRequest( |
| 342 automation(), windex, tab_index, location.x(), location.y(), paths, |
| 343 &error_msg)) { |
| 344 *error = CreateChromeError(error_msg); |
| 345 } |
| 346 } |
| 347 |
| 331 void Automation::SendWebKeyEvent(int tab_id, | 348 void Automation::SendWebKeyEvent(int tab_id, |
| 332 const WebKeyEvent& key_event, | 349 const WebKeyEvent& key_event, |
| 333 Error** error) { | 350 Error** error) { |
| 334 int windex = 0, tab_index = 0; | 351 int windex = 0, tab_index = 0; |
| 335 *error = GetIndicesForTab(tab_id, &windex, &tab_index); | 352 *error = GetIndicesForTab(tab_id, &windex, &tab_index); |
| 336 if (*error) | 353 if (*error) |
| 337 return; | 354 return; |
| 338 | 355 |
| 339 std::string error_msg; | 356 std::string error_msg; |
| 340 if (!SendWebKeyEventJSONRequest( | 357 if (!SendWebKeyEventJSONRequest( |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 768, 0, "Alerts are not supported for this version of Chrome"); | 664 768, 0, "Alerts are not supported for this version of Chrome"); |
| 648 } | 665 } |
| 649 | 666 |
| 650 Error* Automation::CheckAdvancedInteractionsSupported() { | 667 Error* Automation::CheckAdvancedInteractionsSupported() { |
| 651 const char* message = | 668 const char* message = |
| 652 "Advanced user interactions are not supported for this version of Chrome"; | 669 "Advanced user interactions are not supported for this version of Chrome"; |
| 653 return CheckVersion(750, 0, message); | 670 return CheckVersion(750, 0, message); |
| 654 } | 671 } |
| 655 | 672 |
| 656 } // namespace webdriver | 673 } // namespace webdriver |
| OLD | NEW |