| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 if (*error) | 301 if (*error) |
| 302 return; | 302 return; |
| 303 | 303 |
| 304 std::string error_msg; | 304 std::string error_msg; |
| 305 if (!SendMouseDoubleClickJSONRequest( | 305 if (!SendMouseDoubleClickJSONRequest( |
| 306 automation(), windex, tab_index, p.x(), p.y(), &error_msg)) { | 306 automation(), windex, tab_index, p.x(), p.y(), &error_msg)) { |
| 307 *error = CreateChromeError(error_msg); | 307 *error = CreateChromeError(error_msg); |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 | 310 |
| 311 void Automation::SetFilePathsToFileUploadControl( |
| 312 int tab_id, const gfx::Point& location, |
| 313 const std::vector<std::string>& paths, Error** error) { |
| 314 int windex = 0, tab_index = 0; |
| 315 *error = GetIndicesForTab(tab_id, &windex, &tab_index); |
| 316 if (*error) { |
| 317 return; |
| 318 } |
| 319 |
| 320 std::string error_msg; |
| 321 if (!SendSetFilePathsToFileUploadControlJSONRequest( |
| 322 automation(), windex, tab_index, location.x(), location.y(), paths, |
| 323 &error_msg)) { |
| 324 *error = CreateChromeError(error_msg); |
| 325 } |
| 326 } |
| 327 |
| 311 void Automation::SendWebKeyEvent(int tab_id, | 328 void Automation::SendWebKeyEvent(int tab_id, |
| 312 const WebKeyEvent& key_event, | 329 const WebKeyEvent& key_event, |
| 313 Error** error) { | 330 Error** error) { |
| 314 int windex = 0, tab_index = 0; | 331 int windex = 0, tab_index = 0; |
| 315 *error = GetIndicesForTab(tab_id, &windex, &tab_index); | 332 *error = GetIndicesForTab(tab_id, &windex, &tab_index); |
| 316 if (*error) | 333 if (*error) |
| 317 return; | 334 return; |
| 318 | 335 |
| 319 std::string error_msg; | 336 std::string error_msg; |
| 320 if (!SendWebKeyEventJSONRequest( | 337 if (!SendWebKeyEventJSONRequest( |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 return CreateChromeError(error_msg); | 583 return CreateChromeError(error_msg); |
| 567 } | 584 } |
| 568 return NULL; | 585 return NULL; |
| 569 } | 586 } |
| 570 | 587 |
| 571 Error* Automation::CreateChromeError(const std::string& message) { | 588 Error* Automation::CreateChromeError(const std::string& message) { |
| 572 return new Error(kUnknownError, "Internal Chrome error: " + message); | 589 return new Error(kUnknownError, "Internal Chrome error: " + message); |
| 573 } | 590 } |
| 574 | 591 |
| 575 } // namespace webdriver | 592 } // namespace webdriver |
| OLD | NEW |