Chromium Code Reviews| 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/extension_proxy.h" | 9 #include "chrome/test/automation/extension_proxy.h" |
| 10 #include "chrome/test/automation/tab_proxy.h" | 10 #include "chrome/test/automation/tab_proxy.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 wait_for_open); | 237 wait_for_open); |
| 238 EXPECT_TRUE(completed); | 238 EXPECT_TRUE(completed); |
| 239 return completed; | 239 return completed; |
| 240 } | 240 } |
| 241 | 241 |
| 242 std::string PyUITestBase::_GetBookmarksAsJSON() { | 242 std::string PyUITestBase::_GetBookmarksAsJSON() { |
| 243 scoped_refptr<BrowserProxy> browser_proxy = | 243 scoped_refptr<BrowserProxy> browser_proxy = |
| 244 automation()->GetBrowserWindow(0); // Window doesn't matter. | 244 automation()->GetBrowserWindow(0); // Window doesn't matter. |
| 245 EXPECT_TRUE(browser_proxy.get()); | 245 EXPECT_TRUE(browser_proxy.get()); |
| 246 if (!browser_proxy.get()) | 246 if (!browser_proxy.get()) |
| 247 return false; | 247 return NULL; |
|
Nirnimesh
2011/05/04 18:45:39
This should be changed to std::string("{}") to ind
| |
| 248 | 248 |
| 249 std::string s; | 249 std::string s; |
| 250 EXPECT_TRUE(browser_proxy->GetBookmarksAsJSON(&s)); | 250 EXPECT_TRUE(browser_proxy->GetBookmarksAsJSON(&s)); |
| 251 return s; | 251 return s; |
| 252 } | 252 } |
| 253 | 253 |
| 254 bool PyUITestBase::AddBookmarkGroup(std::wstring& parent_id, int index, | 254 bool PyUITestBase::AddBookmarkGroup(std::wstring& parent_id, int index, |
| 255 std::wstring& title) { | 255 std::wstring& title) { |
| 256 scoped_refptr<BrowserProxy> browser_proxy = | 256 scoped_refptr<BrowserProxy> browser_proxy = |
| 257 automation()->GetBrowserWindow(0); // Window doesn't matter. | 257 automation()->GetBrowserWindow(0); // Window doesn't matter. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 // TODO(phadjan.jr): figure out a way to unambiguously report error. | 397 // TODO(phadjan.jr): figure out a way to unambiguously report error. |
| 398 if (!browser_proxy.get()) | 398 if (!browser_proxy.get()) |
| 399 return cookie_val; | 399 return cookie_val; |
| 400 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); | 400 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); |
| 401 EXPECT_TRUE(tab_proxy.get()); | 401 EXPECT_TRUE(tab_proxy.get()); |
| 402 if (!tab_proxy.get()) | 402 if (!tab_proxy.get()) |
| 403 return cookie_val; | 403 return cookie_val; |
| 404 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); | 404 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); |
| 405 return cookie_val; | 405 return cookie_val; |
| 406 } | 406 } |
| OLD | NEW |