| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // Meta-method. Experimental pattern of passing args and response as | 146 // Meta-method. Experimental pattern of passing args and response as |
| 147 // JSON dict to avoid future use of the SWIG interface and | 147 // JSON dict to avoid future use of the SWIG interface and |
| 148 // automation proxy additions. Returns response as JSON dict. | 148 // automation proxy additions. Returns response as JSON dict. |
| 149 std::string _SendJSONRequest(int window_index, std::string& request); | 149 std::string _SendJSONRequest(int window_index, std::string& request); |
| 150 | 150 |
| 151 // Resets to the default theme. Returns true on success. | 151 // Resets to the default theme. Returns true on success. |
| 152 bool ResetToDefaultTheme(); | 152 bool ResetToDefaultTheme(); |
| 153 | 153 |
| 154 // Sets a cookie value for a url. Returns true on success. | 154 // Sets a cookie value for a url. Returns true on success. |
| 155 bool SetCookie(const GURL& cookie_url, const std::string& value, | 155 bool SetCookie(const GURL& cookie_url, const std::string& value, |
| 156 int window_index=0, int tab_index=0); | 156 int window_index = 0, int tab_index = 0); |
| 157 // Gets a cookie value for the given url. | 157 // Gets a cookie value for the given url. |
| 158 std::string GetCookie(const GURL& cookie_url, int window_index=0, | 158 std::string GetCookie(const GURL& cookie_url, int window_index = 0, |
| 159 int tab_index=0); | 159 int tab_index = 0); |
| 160 | 160 |
| 161 private: | 161 private: |
| 162 // Enables PostTask to main thread. | 162 // Enables PostTask to main thread. |
| 163 // Should be shared across multiple instances of PyUITestBase so that this | 163 // Should be shared across multiple instances of PyUITestBase so that this |
| 164 // class is re-entrant and multiple instances can be created. | 164 // class is re-entrant and multiple instances can be created. |
| 165 // This is necessary since python's unittest module creates instances of | 165 // This is necessary since python's unittest module creates instances of |
| 166 // TestCase at load time itself. | 166 // TestCase at load time itself. |
| 167 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); | 167 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); |
| 168 static MessageLoop* message_loop_; | 168 static MessageLoop* message_loop_; |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ | 171 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ |
| 172 | |
| OLD | NEW |