| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/string_number_conversions.h" | 6 #include "base/string_number_conversions.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/test/automation/automation_proxy.h" | 9 #include "chrome/test/automation/automation_proxy.h" |
| 10 #include "chrome/test/automation/extension_proxy.h" | 10 #include "chrome/test/automation/extension_proxy.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 bool app_closed; | 195 bool app_closed; |
| 196 return CloseBrowser(browser_proxy.get(), &app_closed); | 196 return CloseBrowser(browser_proxy.get(), &app_closed); |
| 197 } | 197 } |
| 198 | 198 |
| 199 int PyUITestBase::GetBrowserWindowCount() { | 199 int PyUITestBase::GetBrowserWindowCount() { |
| 200 int num_windows = 0; | 200 int num_windows = 0; |
| 201 EXPECT_TRUE(automation()->GetBrowserWindowCount(&num_windows)); | 201 EXPECT_TRUE(automation()->GetBrowserWindowCount(&num_windows)); |
| 202 return num_windows; | 202 return num_windows; |
| 203 } | 203 } |
| 204 | 204 |
| 205 std::string PyUITestBase::InstallExtension(const FilePath& crx_file, | 205 std::string PyUITestBase::InstallExtension(const std::string& extension_path, |
| 206 bool with_ui) { | 206 bool with_ui) { |
| 207 scoped_refptr<ExtensionProxy> proxy = | 207 scoped_refptr<ExtensionProxy> proxy = |
| 208 automation()->InstallExtension(crx_file, with_ui); | 208 automation()->InstallExtension(extension_path, with_ui); |
| 209 std::string id; | 209 std::string id; |
| 210 if (!proxy.get() || !proxy.get()->GetId(&id)) | 210 if (!proxy.get() || !proxy.get()->GetId(&id)) |
| 211 return ""; | 211 return ""; |
| 212 return id; | 212 return id; |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool PyUITestBase::GetBookmarkBarVisibility() { | 215 bool PyUITestBase::GetBookmarkBarVisibility() { |
| 216 scoped_refptr<BrowserProxy> browser_proxy = | 216 scoped_refptr<BrowserProxy> browser_proxy = |
| 217 automation()->GetBrowserWindow(0); // Window doesn't matter. | 217 automation()->GetBrowserWindow(0); // Window doesn't matter. |
| 218 EXPECT_TRUE(browser_proxy.get()); | 218 EXPECT_TRUE(browser_proxy.get()); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 // TODO(phadjan.jr): figure out a way to unambiguously report error. | 398 // TODO(phadjan.jr): figure out a way to unambiguously report error. |
| 399 if (!browser_proxy.get()) | 399 if (!browser_proxy.get()) |
| 400 return cookie_val; | 400 return cookie_val; |
| 401 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); | 401 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); |
| 402 EXPECT_TRUE(tab_proxy.get()); | 402 EXPECT_TRUE(tab_proxy.get()); |
| 403 if (!tab_proxy.get()) | 403 if (!tab_proxy.get()) |
| 404 return cookie_val; | 404 return cookie_val; |
| 405 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); | 405 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); |
| 406 return cookie_val; | 406 return cookie_val; |
| 407 } | 407 } |
| OLD | NEW |