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/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/test/automation/automation_proxy.h" | 11 #include "chrome/test/automation/automation_proxy.h" |
12 #include "chrome/test/automation/extension_proxy.h" | 12 #include "chrome/test/automation/extension_proxy.h" |
13 #include "chrome/test/automation/tab_proxy.h" | 13 #include "chrome/test/automation/tab_proxy.h" |
14 #include "chrome/test/pyautolib/pyautolib.h" | 14 #include "chrome/test/pyautolib/pyautolib.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 | 16 |
17 static int64 StringToId(const std::wstring& str) { | 17 static int64 StringToId(const std::wstring& str) { |
18 int64 id; | 18 int64 id; |
19 base::StringToInt64(WideToUTF8(str), &id); | 19 base::StringToInt64(WideToUTF8(str), &id); |
20 return id; | 20 return id; |
21 } | 21 } |
22 | 22 |
23 // PyUITestSuiteBase | 23 // PyUITestSuiteBase |
24 PyUITestSuiteBase::PyUITestSuiteBase(int argc, char** argv) | 24 PyUITestSuiteBase::PyUITestSuiteBase(int argc, char** argv) |
25 : UITestSuite(argc, argv) { | 25 : UITestSuite(argc, argv) { |
26 } | 26 } |
27 | 27 |
28 PyUITestSuiteBase::~PyUITestSuiteBase() { | 28 PyUITestSuiteBase::~PyUITestSuiteBase() { |
| 29 #if defined(OS_MACOSX) |
29 pool_.Recycle(); | 30 pool_.Recycle(); |
| 31 #endif |
30 Shutdown(); | 32 Shutdown(); |
31 } | 33 } |
32 | 34 |
33 void PyUITestSuiteBase::InitializeWithPath(const FilePath& browser_dir) { | 35 void PyUITestSuiteBase::InitializeWithPath(const FilePath& browser_dir) { |
34 SetBrowserDirectory(browser_dir); | 36 SetBrowserDirectory(browser_dir); |
35 UITestSuite::Initialize(); | 37 UITestSuite::Initialize(); |
36 } | 38 } |
37 | 39 |
38 void PyUITestSuiteBase::SetCrSourceRoot(const FilePath& path) { | 40 void PyUITestSuiteBase::SetCrSourceRoot(const FilePath& path) { |
39 PathService::Override(base::DIR_SOURCE_ROOT, path); | 41 PathService::Override(base::DIR_SOURCE_ROOT, path); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // TODO(phadjan.jr): figure out a way to unambiguously report error. | 395 // TODO(phadjan.jr): figure out a way to unambiguously report error. |
394 if (!browser_proxy.get()) | 396 if (!browser_proxy.get()) |
395 return cookie_val; | 397 return cookie_val; |
396 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); | 398 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); |
397 EXPECT_TRUE(tab_proxy.get()); | 399 EXPECT_TRUE(tab_proxy.get()); |
398 if (!tab_proxy.get()) | 400 if (!tab_proxy.get()) |
399 return cookie_val; | 401 return cookie_val; |
400 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); | 402 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); |
401 return cookie_val; | 403 return cookie_val; |
402 } | 404 } |
OLD | NEW |