| 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" |
| 11 #include "chrome/test/pyautolib/pyautolib.h" | 11 #include "chrome/test/pyautolib/pyautolib.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 | 13 |
| 14 static int64 StringToId(const std::wstring& str) { | 14 static int64 StringToId(const std::wstring& str) { |
| 15 int64 id; | 15 int64 id; |
| 16 base::StringToInt64(WideToUTF8(str), &id); | 16 base::StringToInt64(WideToUTF8(str), &id); |
| 17 return id; | 17 return id; |
| 18 } | 18 } |
| 19 | 19 |
| 20 // PyUITestSuiteBase | 20 // PyUITestSuiteBase |
| 21 PyUITestSuiteBase::PyUITestSuiteBase(int argc, char** argv) | 21 PyUITestSuiteBase::PyUITestSuiteBase(int argc, char** argv) |
| 22 : UITestSuite(argc, argv) { | 22 : UITestSuite(argc, argv) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 PyUITestSuiteBase::~PyUITestSuiteBase() { | 25 PyUITestSuiteBase::~PyUITestSuiteBase() { |
| 26 pool_.Recycle(); | 26 pool_.Recycle(); |
| 27 Shutdown(); | 27 Shutdown(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void PyUITestSuiteBase::Initialize(const FilePath& browser_dir) { | 30 void PyUITestSuiteBase::InitializeWithPath(const FilePath& browser_dir) { |
| 31 SetBrowserDirectory(browser_dir); | 31 SetBrowserDirectory(browser_dir); |
| 32 UITestSuite::Initialize(); | 32 UITestSuite::Initialize(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void PyUITestSuiteBase::SetCrSourceRoot(const FilePath& path) { | 35 void PyUITestSuiteBase::SetCrSourceRoot(const FilePath& path) { |
| 36 PathService::Override(base::DIR_SOURCE_ROOT, path); | 36 PathService::Override(base::DIR_SOURCE_ROOT, path); |
| 37 } | 37 } |
| 38 | 38 |
| 39 // PyUITestBase | 39 // PyUITestBase |
| 40 PyUITestBase::PyUITestBase(bool clear_profile, std::wstring homepage) | 40 PyUITestBase::PyUITestBase(bool clear_profile, std::wstring homepage) |
| (...skipping 356 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 |