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 // Swig Interface for PyAuto. | 5 // Swig Interface for PyAuto. |
6 // PyAuto makes the Automation Proxy interface available in Python | 6 // PyAuto makes the Automation Proxy interface available in Python |
7 // | 7 // |
8 // Running swig as: | 8 // Running swig as: |
9 // swig -python -c++ chrome/test/pyautolib/pyautolib.i | 9 // swig -python -c++ chrome/test/pyautolib/pyautolib.i |
10 // would generate pyautolib.py, pyautolib_wrap.cxx | 10 // would generate pyautolib.py, pyautolib_wrap.cxx |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 %feature("docstring", "Determine if the profile is set to be cleared on " | 269 %feature("docstring", "Determine if the profile is set to be cleared on " |
270 "next startup.") get_clear_profile; | 270 "next startup.") get_clear_profile; |
271 bool get_clear_profile() const; | 271 bool get_clear_profile() const; |
272 %feature("docstring", "If False, sets the flag so that the profile is " | 272 %feature("docstring", "If False, sets the flag so that the profile is " |
273 "not cleared on next startup. Useful for persisting profile " | 273 "not cleared on next startup. Useful for persisting profile " |
274 "across restarts. By default the state is True, to clear profile.") | 274 "across restarts. By default the state is True, to clear profile.") |
275 set_clear_profile; | 275 set_clear_profile; |
276 void set_clear_profile(bool clear_profile); | 276 void set_clear_profile(bool clear_profile); |
277 | 277 |
278 // Get/fetch properties | |
279 %feature("docstring", | |
280 "Get the path to download directory.") GetDownloadDirectory; | |
281 FilePath GetDownloadDirectory(); | |
282 | |
283 %feature("docstring", "Get the path to profile directory.") user_data_dir; | 278 %feature("docstring", "Get the path to profile directory.") user_data_dir; |
284 FilePath user_data_dir() const; | 279 FilePath user_data_dir() const; |
285 | 280 |
286 %feature("docstring", "Set download shelf visibility for the given or " | |
287 "first browser window.") SetDownloadShelfVisible; | |
288 void SetDownloadShelfVisible(bool is_visible, int window_index=0); | |
289 | |
290 %feature("docstring", "Determine if the download shelf is visible in the " | |
291 "given or first browser window.") IsDownloadShelfVisible; | |
292 bool IsDownloadShelfVisible(int window_index=0); | |
293 | |
294 %feature("docstring", "Determine if the bookmark bar is visible. " | 281 %feature("docstring", "Determine if the bookmark bar is visible. " |
295 "If the NTP is visible, only return true if attached " | 282 "If the NTP is visible, only return true if attached " |
296 "(to the chrome).") GetBookmarkBarVisibility; | 283 "(to the chrome).") GetBookmarkBarVisibility; |
297 bool GetBookmarkBarVisibility(); | 284 bool GetBookmarkBarVisibility(); |
298 | 285 |
299 %feature("docstring", "Determine if the bookmark bar is detached. " | 286 %feature("docstring", "Determine if the bookmark bar is detached. " |
300 "This usually is only true on the NTP.") IsBookmarkBarDetached; | 287 "This usually is only true on the NTP.") IsBookmarkBarDetached; |
301 bool IsBookmarkBarDetached(); | 288 bool IsBookmarkBarDetached(); |
302 | 289 |
303 %feature("docstring", "Wait for the bookmark bar animation to complete. " | 290 %feature("docstring", "Wait for the bookmark bar animation to complete. " |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 %feature("docstring", "Open a new browser window.") OpenNewBrowserWindow; | 343 %feature("docstring", "Open a new browser window.") OpenNewBrowserWindow; |
357 bool OpenNewBrowserWindow(bool show); | 344 bool OpenNewBrowserWindow(bool show); |
358 | 345 |
359 %feature("docstring", "Close a browser window.") CloseBrowserWindow; | 346 %feature("docstring", "Close a browser window.") CloseBrowserWindow; |
360 bool CloseBrowserWindow(int window_index); | 347 bool CloseBrowserWindow(int window_index); |
361 | 348 |
362 %feature("docstring", "Fetch the number of browser windows. Includes popups.") | 349 %feature("docstring", "Fetch the number of browser windows. Includes popups.") |
363 GetBrowserWindowCount; | 350 GetBrowserWindowCount; |
364 int GetBrowserWindowCount(); | 351 int GetBrowserWindowCount(); |
365 | 352 |
366 %feature("docstring", "Set the value of the cookie at cookie_url to value " | |
367 "for the given window index and tab index. " | |
368 "Returns True on success.") SetCookie; | |
369 bool SetCookie(const GURL& cookie_url, const std::string& value, | |
370 int window_index=0, int tab_index=0); | |
371 | |
372 %feature("docstring", "Get the value of the cookie at cookie_url for the " | |
373 "given window index and tab index. " | |
374 "Returns empty string on error or if there is no value for the " | |
375 "cookie.") GetCookie; | |
376 std::string GetCookie(const GURL& cookie_url, int window_index=0, | |
377 int tab_index=0); | |
378 | |
379 // Misc methods | 353 // Misc methods |
380 %feature("docstring", "Get a proxy to the browser window at the given " | 354 %feature("docstring", "Get a proxy to the browser window at the given " |
381 "zero-based index.") GetBrowserWindow; | 355 "zero-based index.") GetBrowserWindow; |
382 scoped_refptr<BrowserProxy> GetBrowserWindow(int window_index); | 356 scoped_refptr<BrowserProxy> GetBrowserWindow(int window_index); |
383 | 357 |
384 // Meta-method | 358 // Meta-method |
385 %feature("docstring", "Send a sync JSON request to Chrome. " | 359 %feature("docstring", "Send a sync JSON request to Chrome. " |
386 "Returns a JSON dict as a response. " | 360 "Returns a JSON dict as a response. " |
387 "Given timeout in milliseconds." | 361 "Given timeout in milliseconds." |
388 "Internal method.") | 362 "Internal method.") |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 // Initialize a new HTTPSOptions that will use the specified certificate. | 444 // Initialize a new HTTPSOptions that will use the specified certificate. |
471 explicit HTTPSOptions(ServerCertificate cert); | 445 explicit HTTPSOptions(ServerCertificate cert); |
472 }; | 446 }; |
473 | 447 |
474 %{ | 448 %{ |
475 typedef net::TestServer::HTTPSOptions HTTPSOptions; | 449 typedef net::TestServer::HTTPSOptions HTTPSOptions; |
476 %} | 450 %} |
477 | 451 |
478 %pointer_class(int, int_ptr); | 452 %pointer_class(int, int_ptr); |
479 %pointer_class(uint32, uint32_ptr); | 453 %pointer_class(uint32, uint32_ptr); |
OLD | NEW |