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

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

Issue 6330012: Cookie commands for the webdriver protocol (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: dsdsdsdjsdsj Created 9 years, 10 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 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 void Automation::GetURL(std::string* url, 85 void Automation::GetURL(std::string* url,
86 bool* success) { 86 bool* success) {
87 GURL gurl; 87 GURL gurl;
88 *success = tab_->GetCurrentURL(&gurl); 88 *success = tab_->GetCurrentURL(&gurl);
89 if (*success) 89 if (*success)
90 *url = gurl.possibly_invalid_spec(); 90 *url = gurl.possibly_invalid_spec();
91 } 91 }
92 92
93 void Automation::GetGURL(GURL* gurl,
94 bool* success) {
95 *success = tab_->GetCurrentURL(gurl);
96 }
97
93 void Automation::GetTabTitle(std::string* tab_title, 98 void Automation::GetTabTitle(std::string* tab_title,
94 bool* success) { 99 bool* success) {
95 std::wstring wide_title; 100 std::wstring wide_title;
96 *success = tab_->GetTabTitle(&wide_title); 101 *success = tab_->GetTabTitle(&wide_title);
97 if (*success) 102 if (*success)
98 *tab_title = WideToUTF8(wide_title); 103 *tab_title = WideToUTF8(wide_title);
99 } 104 }
100 105
106 void Automation::GetCookies(const GURL& gurl,
107 std::string* cookies,
108 bool* success) {
109 *success = tab_->GetCookies(gurl, cookies);
110 }
111
112 void Automation::GetCookieByName(const GURL& gurl,
113 const std::string& cookie_name,
114 std::string* cookie,
115 bool* success) {
116 *success = tab_->GetCookieByName(gurl, cookie_name, cookie);
117 }
118
119 void Automation::DeleteCookie(const GURL& gurl,
120 const std::string& cookie_name,
121 bool* success) {
122 *success = tab_->DeleteCookie(gurl, cookie_name);
123 }
124
125 void Automation::SetCookie(const GURL& gurl,
126 const std::string& cookie,
127 bool* success) {
128 *success = tab_->SetCookie(gurl, cookie);
John Grabowski 2011/02/14 21:59:06 You probably also need a Automation::SetCookie(co
Joe 2011/02/15 02:30:48 I am not sure why? I don't think chromedriver nee
129 }
130
101 } // namespace webdriver 131 } // namespace webdriver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698