OLD | NEW |
1 // Copyright (c) 2010 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 // This file declares the C++ side of PyAuto, the python interface to | 5 // This file declares the C++ side of PyAuto, the python interface to |
6 // Chromium automation. It access Chromium's internals using Automation Proxy. | 6 // Chromium automation. It access Chromium's internals using Automation Proxy. |
7 | 7 |
8 #ifndef CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ | 8 #ifndef CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ |
9 #define CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ | 9 #define CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/mac/scoped_nsautorelease_pool.h" | 13 #include "base/mac/scoped_nsautorelease_pool.h" |
| 14 #include "base/test/test_timeouts.h" |
14 #include "chrome/test/ui/ui_test.h" | 15 #include "chrome/test/ui/ui_test.h" |
15 #include "chrome/test/ui/ui_test_suite.h" | 16 #include "chrome/test/ui/ui_test_suite.h" |
16 | 17 |
17 // The C++ style guide forbids using default arguments but I'm taking the | 18 // The C++ style guide forbids using default arguments but I'm taking the |
18 // liberty of allowing it in this file. The sole purpose of this (and the | 19 // liberty of allowing it in this file. The sole purpose of this (and the |
19 // .cc) is to support the python interface, and default args are allowed in | 20 // .cc) is to support the python interface, and default args are allowed in |
20 // python. Strictly adhering to the guide here would mean having to re-define | 21 // python. Strictly adhering to the guide here would mean having to re-define |
21 // all methods in python just for the sake of providing default args. This | 22 // all methods in python just for the sake of providing default args. This |
22 // seems cumbersome and unwanted. | 23 // seems cumbersome and unwanted. |
23 | 24 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // Resets to the default theme. Returns true on success. | 178 // Resets to the default theme. Returns true on success. |
178 bool ResetToDefaultTheme(); | 179 bool ResetToDefaultTheme(); |
179 | 180 |
180 // Sets a cookie value for a url. Returns true on success. | 181 // Sets a cookie value for a url. Returns true on success. |
181 bool SetCookie(const GURL& cookie_url, const std::string& value, | 182 bool SetCookie(const GURL& cookie_url, const std::string& value, |
182 int window_index = 0, int tab_index = 0); | 183 int window_index = 0, int tab_index = 0); |
183 // Gets a cookie value for the given url. | 184 // Gets a cookie value for the given url. |
184 std::string GetCookie(const GURL& cookie_url, int window_index = 0, | 185 std::string GetCookie(const GURL& cookie_url, int window_index = 0, |
185 int tab_index = 0); | 186 int tab_index = 0); |
186 | 187 |
| 188 int action_max_timeout_ms() const { |
| 189 return TestTimeouts::action_max_timeout_ms(); |
| 190 } |
| 191 |
187 private: | 192 private: |
188 // Enables PostTask to main thread. | 193 // Enables PostTask to main thread. |
189 // Should be shared across multiple instances of PyUITestBase so that this | 194 // Should be shared across multiple instances of PyUITestBase so that this |
190 // class is re-entrant and multiple instances can be created. | 195 // class is re-entrant and multiple instances can be created. |
191 // This is necessary since python's unittest module creates instances of | 196 // This is necessary since python's unittest module creates instances of |
192 // TestCase at load time itself. | 197 // TestCase at load time itself. |
193 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); | 198 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); |
194 static MessageLoop* message_loop_; | 199 static MessageLoop* message_loop_; |
195 }; | 200 }; |
196 | 201 |
197 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ | 202 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ |
OLD | NEW |