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

Side by Side Diff: chrome/test/webdriver/automation.cc

Issue 6705004: Return the full cookie details in TestingAutomationProvider and pass around (Closed) Base URL: svn://svn.chromium.org/chrome/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
« no previous file with comments | « chrome/test/webdriver/automation.h ('k') | chrome/test/webdriver/commands/cookie_commands.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 int windex = 0, tab_index = 0; 307 int windex = 0, tab_index = 0;
308 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { 308 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) {
309 *success = false; 309 *success = false;
310 return; 310 return;
311 } 311 }
312 312
313 *success = SendGetTabTitleJSONRequest( 313 *success = SendGetTabTitleJSONRequest(
314 automation(), windex, tab_index, tab_title); 314 automation(), windex, tab_index, tab_title);
315 } 315 }
316 316
317 void Automation::GetCookies(int tab_id, 317 void Automation::GetCookies(const std::string& url,
318 const GURL& gurl, 318 ListValue** cookies,
319 std::string* cookies,
320 bool* success) { 319 bool* success) {
320 *success = SendGetCookiesJSONRequest(automation(), url, cookies);
321 }
322
323 void Automation::GetCookiesDeprecated(int tab_id,
324 const GURL& gurl,
325 std::string* cookies,
326 bool* success) {
321 int windex = 0, tab_index = 0; 327 int windex = 0, tab_index = 0;
322 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { 328 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) {
323 *success = false; 329 *success = false;
324 return; 330 return;
325 } 331 }
326 332
327 *success = SendGetCookiesJSONRequest( 333 *success = SendGetCookiesJSONRequestDeprecated(
328 automation(), windex, gurl.possibly_invalid_spec(), cookies); 334 automation(), windex, gurl.possibly_invalid_spec(), cookies);
329 } 335 }
330 336
331 void Automation::DeleteCookie(int tab_id, 337 void Automation::DeleteCookie(const std::string& url,
332 const GURL& gurl,
333 const std::string& cookie_name, 338 const std::string& cookie_name,
334 bool* success) { 339 bool* success) {
340 *success = SendDeleteCookieJSONRequest(automation(), url, cookie_name);
341 }
342
343 void Automation::DeleteCookieDeprecated(int tab_id,
344 const GURL& gurl,
345 const std::string& cookie_name,
346 bool* success) {
335 int windex = 0, tab_index = 0; 347 int windex = 0, tab_index = 0;
336 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { 348 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) {
337 *success = false; 349 *success = false;
338 return; 350 return;
339 } 351 }
340 352
341 *success = SendDeleteCookieJSONRequest( 353 *success = SendDeleteCookieJSONRequestDeprecated(
342 automation(), 354 automation(),
343 windex, 355 windex,
344 gurl.possibly_invalid_spec(), 356 gurl.possibly_invalid_spec(),
345 cookie_name); 357 cookie_name);
346 } 358 }
347 359
348 void Automation::SetCookie(int tab_id, 360 void Automation::SetCookie(const std::string& url,
349 const GURL& gurl, 361 DictionaryValue* cookie_dict,
350 const std::string& cookie,
351 bool* success) { 362 bool* success) {
363 *success = SendSetCookieJSONRequest(automation(), url, cookie_dict);
364 }
365
366 void Automation::SetCookieDeprecated(int tab_id,
367 const GURL& gurl,
368 const std::string& cookie,
369 bool* success) {
352 int windex = 0, tab_index = 0; 370 int windex = 0, tab_index = 0;
353 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { 371 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) {
354 *success = false; 372 *success = false;
355 return; 373 return;
356 } 374 }
357 375
358 *success = SendSetCookieJSONRequest( 376 *success = SendSetCookieJSONRequestDeprecated(
359 automation(), 377 automation(),
360 windex, 378 windex,
361 gurl.possibly_invalid_spec(), 379 gurl.possibly_invalid_spec(),
362 cookie); 380 cookie);
363 } 381 }
364 382
365 void Automation::GetTabIds(std::vector<int>* tab_ids, 383 void Automation::GetTabIds(std::vector<int>* tab_ids,
366 bool* success) { 384 bool* success) {
367 *success = SendGetTabIdsJSONRequest(automation(), tab_ids); 385 *success = SendGetTabIdsJSONRequest(automation(), tab_ids);
368 } 386 }
369 387
370 void Automation::DoesTabExist(int tab_id, bool* does_exist, bool* success) { 388 void Automation::DoesTabExist(int tab_id, bool* does_exist, bool* success) {
371 *success = SendIsTabIdValidJSONRequest(automation(), tab_id, does_exist); 389 *success = SendIsTabIdValidJSONRequest(automation(), tab_id, does_exist);
372 } 390 }
373 391
374 void Automation::CloseTab(int tab_id, bool* success) { 392 void Automation::CloseTab(int tab_id, bool* success) {
375 int windex = 0, tab_index = 0; 393 int windex = 0, tab_index = 0;
376 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) { 394 if (!GetIndicesForTab(tab_id, &windex, &tab_index)) {
377 *success = false; 395 *success = false;
378 return; 396 return;
379 } 397 }
380 398
381 *success = SendCloseTabJSONRequest(automation(), windex, tab_index); 399 *success = SendCloseTabJSONRequest(automation(), windex, tab_index);
382 } 400 }
383 401
384 void Automation::GetVersion(std::string* version) { 402 void Automation::GetBrowserVersion(std::string* version) {
385 *version = automation()->server_version(); 403 *version = automation()->server_version();
386 } 404 }
387 405
388 void Automation::WaitForAllTabsToStopLoading(bool* success) { 406 void Automation::WaitForAllTabsToStopLoading(bool* success) {
389 *success = SendWaitForAllTabsToStopLoadingJSONRequest(automation()); 407 *success = SendWaitForAllTabsToStopLoadingJSONRequest(automation());
390 } 408 }
391 409
392 AutomationProxy* Automation::automation() const { 410 AutomationProxy* Automation::automation() const {
393 return launcher_->automation(); 411 return launcher_->automation();
394 } 412 }
395 413
396 bool Automation::GetIndicesForTab( 414 bool Automation::GetIndicesForTab(
397 int tab_id, int* browser_index, int* tab_index) { 415 int tab_id, int* browser_index, int* tab_index) {
398 if (!SendGetIndicesFromTabIdJSONRequest(automation(), tab_id, 416 if (!SendGetIndicesFromTabIdJSONRequest(automation(), tab_id,
399 browser_index, tab_index)) { 417 browser_index, tab_index)) {
400 LOG(ERROR) << "Could not get browser and tab indices for WebDriver tab id"; 418 LOG(ERROR) << "Could not get browser and tab indices for WebDriver tab id";
401 return false; 419 return false;
402 } 420 }
403 return true; 421 return true;
404 } 422 }
405 423
406 } // namespace webdriver 424 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/automation.h ('k') | chrome/test/webdriver/commands/cookie_commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698