Chromium Code Reviews| Index: chrome/test/webdriver/session.cc |
| diff --git a/chrome/test/webdriver/session.cc b/chrome/test/webdriver/session.cc |
| index 6c1b026ed91cf7e390b6ee3eac4cfb9faba0d5bd..8e2448ee37f6a64a9f3aace153bafe0b9810c6bf 100644 |
| --- a/chrome/test/webdriver/session.cc |
| +++ b/chrome/test/webdriver/session.cc |
| @@ -17,11 +17,14 @@ |
| #include "base/json/json_writer.h" |
| #include "base/test/test_timeouts.h" |
| #include "base/utf_string_conversions.h" |
| + |
|
kkania
2011/02/09 16:53:13
no newline here
|
| #include "chrome/app/chrome_command_ids.h" |
| #include "chrome/common/chrome_constants.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/test/test_launcher_utils.h" |
| #include "chrome/test/webdriver/utility_functions.h" |
| + |
|
kkania
2011/02/09 16:53:13
no newline here
|
| +#include "googleurl/src/gurl.h" |
| #include "third_party/webdriver/atoms.h" |
| namespace webdriver { |
| @@ -172,6 +175,16 @@ bool Session::GetURL(std::string* url) { |
| return success; |
| } |
| +bool Session::GetURL(GURL* gurl) { |
| + bool success = false; |
| + RunSessionTask(NewRunnableMethod( |
| + automation_.get(), |
|
kkania
2011/02/09 16:53:13
4 spaces not 2 here
|
| + &Automation::GetGURL, |
| + gurl, |
| + &success)); |
| + return success; |
| +} |
| + |
| bool Session::GetTabTitle(std::string* tab_title) { |
| bool success = false; |
| RunSessionTask(NewRunnableMethod( |
| @@ -182,6 +195,53 @@ bool Session::GetTabTitle(std::string* tab_title) { |
| return success; |
| } |
| +bool Session::GetCookies(const GURL& url, std::string* cookies) { |
| + bool success = false; |
| + RunSessionTask(NewRunnableMethod( |
| + automation_.get(), |
| + &Automation::GetCookies, |
| + url, |
| + cookies, |
| + &success)); |
| + return success; |
| +} |
| + |
| +bool Session::GetCookieByName(const GURL& url, |
| + const std::string& cookie_name, |
| + std::string* cookie) { |
| + bool success = false; |
| + RunSessionTask(NewRunnableMethod( |
| + automation_.get(), |
| + &Automation::GetCookieByName, |
| + url, |
| + cookie_name, |
| + cookie, |
| + &success)); |
| + return success; |
| +} |
| + |
| +bool Session::DeleteCookie(const GURL& url, const std::string& cookie_name) { |
| + bool success = false; |
| + RunSessionTask(NewRunnableMethod( |
| + automation_.get(), |
| + &Automation::DeleteCookie, |
| + url, |
| + cookie_name, |
| + &success)); |
| + return success; |
| +} |
| + |
| +bool Session::SetCookie(const GURL& url, const std::string& cookie) { |
| + bool success = false; |
| + RunSessionTask(NewRunnableMethod( |
| + automation_.get(), |
|
kkania
2011/02/09 16:53:13
4 spaces not 2 here
|
| + &Automation::SetCookie, |
| + url, |
| + cookie, |
| + &success)); |
| + return success; |
| +} |
| + |
| void Session::RunSessionTask(Task* task) { |
| base::WaitableEvent done_event(false, false); |
| thread_.message_loop_proxy()->PostTask(FROM_HERE, NewRunnableMethod( |