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 #if defined(OS_WIN) |
| 208 FilePath extension_file_path = FilePath(ASCIIToWide(extension_path)); |
| 209 #else |
| 210 FilePath extension_file_path = FilePath(extension_path); |
| 211 #endif |
207 scoped_refptr<ExtensionProxy> proxy = | 212 scoped_refptr<ExtensionProxy> proxy = |
208 automation()->InstallExtension(crx_file, with_ui); | 213 automation()->InstallExtension(extension_file_path, with_ui); |
209 std::string id; | 214 std::string id; |
210 if (!proxy.get() || !proxy.get()->GetId(&id)) | 215 if (!proxy.get() || !proxy.get()->GetId(&id)) |
211 return ""; | 216 return ""; |
212 return id; | 217 return id; |
213 } | 218 } |
214 | 219 |
215 bool PyUITestBase::GetBookmarkBarVisibility() { | 220 bool PyUITestBase::GetBookmarkBarVisibility() { |
216 scoped_refptr<BrowserProxy> browser_proxy = | 221 scoped_refptr<BrowserProxy> browser_proxy = |
217 automation()->GetBrowserWindow(0); // Window doesn't matter. | 222 automation()->GetBrowserWindow(0); // Window doesn't matter. |
218 EXPECT_TRUE(browser_proxy.get()); | 223 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. | 403 // TODO(phadjan.jr): figure out a way to unambiguously report error. |
399 if (!browser_proxy.get()) | 404 if (!browser_proxy.get()) |
400 return cookie_val; | 405 return cookie_val; |
401 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); | 406 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); |
402 EXPECT_TRUE(tab_proxy.get()); | 407 EXPECT_TRUE(tab_proxy.get()); |
403 if (!tab_proxy.get()) | 408 if (!tab_proxy.get()) |
404 return cookie_val; | 409 return cookie_val; |
405 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); | 410 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); |
406 return cookie_val; | 411 return cookie_val; |
407 } | 412 } |
OLD | NEW |