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