OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 void PyUITestSuiteBase::InitializeWithPath(const base::FilePath& browser_dir) { | 34 void PyUITestSuiteBase::InitializeWithPath(const base::FilePath& browser_dir) { |
35 SetBrowserDirectory(browser_dir); | 35 SetBrowserDirectory(browser_dir); |
36 UITestSuite::Initialize(); | 36 UITestSuite::Initialize(); |
37 } | 37 } |
38 | 38 |
39 void PyUITestSuiteBase::SetCrSourceRoot(const base::FilePath& path) { | 39 void PyUITestSuiteBase::SetCrSourceRoot(const base::FilePath& path) { |
40 PathService::Override(base::DIR_SOURCE_ROOT, path); | 40 PathService::Override(base::DIR_SOURCE_ROOT, path); |
41 } | 41 } |
42 | 42 |
43 bool PyUITestSuiteBase::IsBrowserTestSuite() { return true; } | |
44 | |
45 // PyUITestBase | 43 // PyUITestBase |
46 PyUITestBase::PyUITestBase(bool clear_profile, std::wstring homepage) | 44 PyUITestBase::PyUITestBase(bool clear_profile, std::wstring homepage) |
47 : UITestBase() { | 45 : UITestBase() { |
48 set_clear_profile(clear_profile); | 46 set_clear_profile(clear_profile); |
49 set_homepage(base::WideToUTF8(homepage)); | 47 set_homepage(base::WideToUTF8(homepage)); |
50 // We add this so that pyauto can execute javascript in the renderer and | 48 // We add this so that pyauto can execute javascript in the renderer and |
51 // read values back. | 49 // read values back. |
52 dom_automation_enabled_ = true; | 50 dom_automation_enabled_ = true; |
53 message_loop_ = GetSharedMessageLoop(base::MessageLoop::TYPE_DEFAULT); | 51 message_loop_ = GetSharedMessageLoop(base::MessageLoop::TYPE_DEFAULT); |
54 } | 52 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 base::StringPrintf("Chrome automation timed out after %d seconds", | 154 base::StringPrintf("Chrome automation timed out after %d seconds", |
157 static_cast<int>(duration.InSeconds())), | 155 static_cast<int>(duration.InSeconds())), |
158 request, true, response); | 156 request, true, response); |
159 } else { | 157 } else { |
160 // TODO(craigdh): Determine specific cause. | 158 // TODO(craigdh): Determine specific cause. |
161 ErrorResponse( | 159 ErrorResponse( |
162 "Chrome automation failed prior to timing out, did chrome crash?", | 160 "Chrome automation failed prior to timing out, did chrome crash?", |
163 request, false, response); | 161 request, false, response); |
164 } | 162 } |
165 } | 163 } |
OLD | NEW |