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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 named_channel_id_ = named_channel_id; | 62 named_channel_id_ = named_channel_id; |
63 launcher_.reset(CreateProxyLauncher()); | 63 launcher_.reset(CreateProxyLauncher()); |
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 // Open the Find box | |
73 void OpenFindInPage(int window_index = 0); | |
74 | |
75 // Determines the visibility of the Find box | |
76 bool IsFindInPageVisible(int window_index = 0); | |
77 | |
78 // AutomationProxy methods | 72 // AutomationProxy methods |
79 | 73 |
80 // Open a new browser window. Returns false on failure. | |
81 bool OpenNewBrowserWindow(bool show); | |
82 | |
83 // Close a browser window. Returns false on failure. | |
84 bool CloseBrowserWindow(int window_index); | |
85 | |
86 // Fetch the number of browser windows. Includes popups. | |
87 int GetBrowserWindowCount(); | |
88 | |
89 // Returns bookmark bar visibility state. | 74 // Returns bookmark bar visibility state. |
90 bool GetBookmarkBarVisibility(); | 75 bool GetBookmarkBarVisibility(); |
91 | 76 |
92 // Returns true if the bookmark bar is visible in the detached state. | 77 // Returns true if the bookmark bar is visible in the detached state. |
93 bool IsBookmarkBarDetached(); | 78 bool IsBookmarkBarDetached(); |
94 | 79 |
95 // Returns bookmark bar animation state. Warning: timing issues may | 80 // Returns bookmark bar animation state. Warning: timing issues may |
96 // change this return value unexpectedly. | 81 // change this return value unexpectedly. |
97 bool IsBookmarkBarAnimating(); | 82 bool IsBookmarkBarAnimating(); |
98 | 83 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 117 |
133 // Meta-methods. Generic pattern of passing args and response as | 118 // Meta-methods. Generic pattern of passing args and response as |
134 // JSON dict to avoid future use of the SWIG interface and | 119 // JSON dict to avoid future use of the SWIG interface and |
135 // automation proxy additions. Returns response as JSON dict. | 120 // automation proxy additions. Returns response as JSON dict. |
136 // Use -ve window_index for automation calls not targetted at a browser | 121 // Use -ve window_index for automation calls not targetted at a browser |
137 // window. Example: Login call for chromeos. | 122 // window. Example: Login call for chromeos. |
138 std::string _SendJSONRequest(int window_index, | 123 std::string _SendJSONRequest(int window_index, |
139 const std::string& request, | 124 const std::string& request, |
140 int timeout); | 125 int timeout); |
141 | 126 |
142 // Resets to the default theme. Returns true on success. | |
143 bool ResetToDefaultTheme(); | |
144 | |
145 // Sets a cookie value for a url. Returns true on success. | 127 // Sets a cookie value for a url. Returns true on success. |
146 bool SetCookie(const GURL& cookie_url, const std::string& value, | 128 bool SetCookie(const GURL& cookie_url, const std::string& value, |
147 int window_index = 0, int tab_index = 0); | 129 int window_index = 0, int tab_index = 0); |
148 // Gets a cookie value for the given url. | 130 // Gets a cookie value for the given url. |
149 std::string GetCookie(const GURL& cookie_url, int window_index = 0, | 131 std::string GetCookie(const GURL& cookie_url, int window_index = 0, |
150 int tab_index = 0); | 132 int tab_index = 0); |
151 | 133 |
152 base::TimeDelta action_max_timeout() const { | 134 base::TimeDelta action_max_timeout() const { |
153 return TestTimeouts::action_max_timeout(); | 135 return TestTimeouts::action_max_timeout(); |
154 } | 136 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // This is necessary since python's unittest module creates instances of | 173 // This is necessary since python's unittest module creates instances of |
192 // TestCase at load time itself. | 174 // TestCase at load time itself. |
193 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); | 175 static MessageLoop* GetSharedMessageLoop(MessageLoop::Type msg_loop_type); |
194 static MessageLoop* message_loop_; | 176 static MessageLoop* message_loop_; |
195 | 177 |
196 // Path to named channel id. | 178 // Path to named channel id. |
197 std::string named_channel_id_; | 179 std::string named_channel_id_; |
198 }; | 180 }; |
199 | 181 |
200 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ | 182 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ |
OLD | NEW |