| 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 // 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 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Resets to the default theme. Returns true on success. | 160 // Resets to the default theme. Returns true on success. |
| 161 bool ResetToDefaultTheme(); | 161 bool ResetToDefaultTheme(); |
| 162 | 162 |
| 163 // Sets a cookie value for a url. Returns true on success. | 163 // Sets a cookie value for a url. Returns true on success. |
| 164 bool SetCookie(const GURL& cookie_url, const std::string& value, | 164 bool SetCookie(const GURL& cookie_url, const std::string& value, |
| 165 int window_index = 0, int tab_index = 0); | 165 int window_index = 0, int tab_index = 0); |
| 166 // Gets a cookie value for the given url. | 166 // Gets a cookie value for the given url. |
| 167 std::string GetCookie(const GURL& cookie_url, int window_index = 0, | 167 std::string GetCookie(const GURL& cookie_url, int window_index = 0, |
| 168 int tab_index = 0); | 168 int tab_index = 0); |
| 169 | 169 |
| 170 base::TimeDelta action_max_timeout() const { |
| 171 return TestTimeouts::action_max_timeout(); |
| 172 } |
| 173 |
| 170 int action_max_timeout_ms() const { | 174 int action_max_timeout_ms() const { |
| 171 return TestTimeouts::action_max_timeout_ms(); | 175 return action_max_timeout().InMilliseconds(); |
| 176 } |
| 177 |
| 178 base::TimeDelta large_test_timeout() const { |
| 179 return TestTimeouts::large_test_timeout(); |
| 172 } | 180 } |
| 173 | 181 |
| 174 int large_test_timeout_ms() const { | 182 int large_test_timeout_ms() const { |
| 175 return TestTimeouts::large_test_timeout_ms(); | 183 return large_test_timeout().InMilliseconds(); |
| 176 } | 184 } |
| 177 | 185 |
| 178 protected: | 186 protected: |
| 179 // Gets the automation proxy and checks that it exists. | 187 // Gets the automation proxy and checks that it exists. |
| 180 virtual AutomationProxy* automation() const OVERRIDE; | 188 virtual AutomationProxy* automation() const OVERRIDE; |
| 181 | 189 |
| 182 virtual void SetLaunchSwitches() OVERRIDE; | 190 virtual void SetLaunchSwitches() OVERRIDE; |
| 183 | 191 |
| 184 private: | 192 private: |
| 185 // Create JSON error responses. | 193 // Create JSON error responses. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 201 // This is necessary since python's unittest module creates instances of | 209 // This is necessary since python's unittest module creates instances of |
| 202 // TestCase at load time itself. | 210 // TestCase at load time itself. |
| 203 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); | 211 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); |
| 204 static MessageLoop* message_loop_; | 212 static MessageLoop* message_loop_; |
| 205 | 213 |
| 206 // Path to named channel id. | 214 // Path to named channel id. |
| 207 std::string named_channel_id_; | 215 std::string named_channel_id_; |
| 208 }; | 216 }; |
| 209 | 217 |
| 210 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ | 218 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ |
| OLD | NEW |