| 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 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 105 } |
| 106 | 106 |
| 107 void Automation::GetURL(std::string* url, | 107 void Automation::GetURL(std::string* url, |
| 108 bool* success) { | 108 bool* success) { |
| 109 GURL gurl; | 109 GURL gurl; |
| 110 *success = tab_->GetCurrentURL(&gurl); | 110 *success = tab_->GetCurrentURL(&gurl); |
| 111 if (*success) | 111 if (*success) |
| 112 *url = gurl.possibly_invalid_spec(); | 112 *url = gurl.possibly_invalid_spec(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void Automation::GetGURL(GURL* gurl, |
| 116 bool* success) { |
| 117 *success = tab_->GetCurrentURL(gurl); |
| 118 } |
| 119 |
| 115 void Automation::GetTabTitle(std::string* tab_title, | 120 void Automation::GetTabTitle(std::string* tab_title, |
| 116 bool* success) { | 121 bool* success) { |
| 117 std::wstring wide_title; | 122 std::wstring wide_title; |
| 118 *success = tab_->GetTabTitle(&wide_title); | 123 *success = tab_->GetTabTitle(&wide_title); |
| 119 if (*success) | 124 if (*success) |
| 120 *tab_title = WideToUTF8(wide_title); | 125 *tab_title = WideToUTF8(wide_title); |
| 121 } | 126 } |
| 122 | 127 |
| 128 void Automation::GetCookies(const GURL& gurl, |
| 129 std::string* cookies, |
| 130 bool* success) { |
| 131 *success = tab_->GetCookies(gurl, cookies); |
| 132 } |
| 133 |
| 134 void Automation::GetCookieByName(const GURL& gurl, |
| 135 const std::string& cookie_name, |
| 136 std::string* cookie, |
| 137 bool* success) { |
| 138 *success = tab_->GetCookieByName(gurl, cookie_name, cookie); |
| 139 } |
| 140 |
| 141 void Automation::DeleteCookie(const GURL& gurl, |
| 142 const std::string& cookie_name, |
| 143 bool* success) { |
| 144 *success = tab_->DeleteCookie(gurl, cookie_name); |
| 145 } |
| 146 |
| 147 void Automation::SetCookie(const GURL& gurl, |
| 148 const std::string& cookie, |
| 149 bool* success) { |
| 150 *success = tab_->SetCookie(gurl, cookie); |
| 151 } |
| 152 |
| 123 } // namespace webdriver | 153 } // namespace webdriver |
| OLD | NEW |