Chromium Code Reviews| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 int windex = 0, tab_index = 0; | 225 int windex = 0, tab_index = 0; |
| 226 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { | 226 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { |
| 227 *success = false; | 227 *success = false; |
| 228 return; | 228 return; |
| 229 } | 229 } |
| 230 | 230 |
| 231 *success = SendWebKeyEventJSONRequest( | 231 *success = SendWebKeyEventJSONRequest( |
| 232 automation(), windex, tab_index, key_event); | 232 automation(), windex, tab_index, key_event); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void Automation::CaptureEntirePageAsPNG(int tab_id, | |
| 236 const FilePath& path, | |
| 237 bool* success) { | |
| 238 int windex = 0, tab_index = 0; | |
| 239 | |
|
kkania
2011/03/17 18:35:11
remove newline here
Joe
2011/03/18 00:33:32
Done.
| |
| 240 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { | |
| 241 *success = false; | |
| 242 return; | |
| 243 } | |
| 244 | |
| 245 *success = SendCaptureEntirePageJSONRequest( | |
| 246 automation(), windex, tab_index, path); | |
| 247 } | |
| 248 | |
| 235 void Automation::NavigateToURL(int tab_id, | 249 void Automation::NavigateToURL(int tab_id, |
| 236 const std::string& url, | 250 const std::string& url, |
| 237 bool* success) { | 251 bool* success) { |
| 238 int browser_index = 0, tab_index = 0; | 252 int browser_index = 0, tab_index = 0; |
| 239 if (!GetIndicesForTab(tab_id, &browser_index, &tab_index)) { | 253 if (!GetIndicesForTab(tab_id, &browser_index, &tab_index)) { |
| 240 *success = false; | 254 *success = false; |
| 241 return; | 255 return; |
| 242 } | 256 } |
| 243 | 257 |
| 244 AutomationMsg_NavigationResponseValues navigate_response; | 258 AutomationMsg_NavigationResponseValues navigate_response; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 int tab_id, int* browser_index, int* tab_index) { | 411 int tab_id, int* browser_index, int* tab_index) { |
| 398 if (!SendGetIndicesFromTabIdJSONRequest(automation(), tab_id, | 412 if (!SendGetIndicesFromTabIdJSONRequest(automation(), tab_id, |
| 399 browser_index, tab_index)) { | 413 browser_index, tab_index)) { |
| 400 LOG(ERROR) << "Could not get browser and tab indices for WebDriver tab id"; | 414 LOG(ERROR) << "Could not get browser and tab indices for WebDriver tab id"; |
| 401 return false; | 415 return false; |
| 402 } | 416 } |
| 403 return true; | 417 return true; |
| 404 } | 418 } |
| 405 | 419 |
| 406 } // namespace webdriver | 420 } // namespace webdriver |
| OLD | NEW |