| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual ProxyLauncher* CreateProxyLauncher() OVERRIDE; | 66 virtual ProxyLauncher* CreateProxyLauncher() OVERRIDE; |
| 67 | 67 |
| 68 // SetUp,TearDown is redeclared as public to make it accessible from swig. | 68 // SetUp,TearDown is redeclared as public to make it accessible from swig. |
| 69 virtual void SetUp() OVERRIDE; | 69 virtual void SetUp() OVERRIDE; |
| 70 virtual void TearDown() OVERRIDE; | 70 virtual void TearDown() OVERRIDE; |
| 71 | 71 |
| 72 // AutomationProxy methods | 72 // AutomationProxy methods |
| 73 | 73 |
| 74 // Get a handle to browser window at the given index, or NULL on failure. | |
| 75 scoped_refptr<BrowserProxy> GetBrowserWindow(int window_index); | |
| 76 | |
| 77 // Meta-methods. Generic pattern of passing args and response as | 74 // Meta-methods. Generic pattern of passing args and response as |
| 78 // JSON dict to avoid future use of the SWIG interface and | 75 // JSON dict to avoid future use of the SWIG interface and |
| 79 // automation proxy additions. Returns response as JSON dict. | 76 // automation proxy additions. Returns response as JSON dict. |
| 80 // Use -ve window_index for automation calls not targetted at a browser | 77 // Use -ve window_index for automation calls not targetted at a browser |
| 81 // window. Example: Login call for chromeos. | 78 // window. Example: Login call for chromeos. |
| 82 std::string _SendJSONRequest(int window_index, | 79 std::string _SendJSONRequest(int window_index, |
| 83 const std::string& request, | 80 const std::string& request, |
| 84 int timeout); | 81 int timeout); |
| 85 | 82 |
| 86 // Sets a cookie value for a url. Returns true on success. | 83 // Sets a cookie value for a url. Returns true on success. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // This is necessary since python's unittest module creates instances of | 126 // This is necessary since python's unittest module creates instances of |
| 130 // TestCase at load time itself. | 127 // TestCase at load time itself. |
| 131 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); | 128 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); |
| 132 static MessageLoop* message_loop_; | 129 static MessageLoop* message_loop_; |
| 133 | 130 |
| 134 // Path to named channel id. | 131 // Path to named channel id. |
| 135 std::string named_channel_id_; | 132 std::string named_channel_id_; |
| 136 }; | 133 }; |
| 137 | 134 |
| 138 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ | 135 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ |
| OLD | NEW |