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

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
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 }
(...skipping 28 matching lines...) Expand all
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

Powered by Google App Engine
This is Rietveld 408576698