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 // Navigation Methods | |
279 %feature("docstring", "Navigate to the given url in the given tab and given " | |
280 "window (or active tab in first window if indexes not given). " | |
281 "Note that this method also activates the corresponding tab/window " | |
282 "if it's not active already. Blocks until page has loaded.") | |
283 NavigateToURL; | |
284 void NavigateToURL(const char* url_string); | |
285 void NavigateToURL(const char* url_string, int window_index); | |
286 void NavigateToURL(const char* url_string, int window_index, int tab_index); | |
287 | |
288 %feature("docstring", "Reload the active tab in the given window (or first " | |
289 "window if index not given). Blocks until page has reloaded.") | |
290 ReloadActiveTab; | |
291 void ReloadActiveTab(int window_index = 0); | |
292 | |
293 // BrowserProxy methods | 278 // BrowserProxy methods |
294 %feature("docstring", "Apply the accelerator with given id " | 279 %feature("docstring", "Apply the accelerator with given id " |
295 "(IDC_BACK, IDC_NEWTAB ...) to the given or first window. " | 280 "(IDC_BACK, IDC_NEWTAB ...) to the given or first window. " |
296 "The list can be found at chrome/app/chrome_dll_resource.h. " | 281 "The list can be found at chrome/app/chrome_dll_resource.h. " |
297 "Note that this method just schedules the accelerator, but does " | 282 "Note that this method just schedules the accelerator, but does " |
298 "not wait for it to actually finish doing anything." | 283 "not wait for it to actually finish doing anything." |
299 "Returns True on success.") | 284 "Returns True on success.") |
300 ApplyAccelerator; | 285 ApplyAccelerator; |
301 bool ApplyAccelerator(int id, int window_index=0); | 286 bool ApplyAccelerator(int id, int window_index=0); |
302 %feature("docstring", "Like ApplyAccelerator, except that it waits for " | 287 %feature("docstring", "Like ApplyAccelerator, except that it waits for " |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 "first window.") GetActiveTabTitle; | 391 "first window.") GetActiveTabTitle; |
407 std::wstring GetActiveTabTitle(int window_index=0); | 392 std::wstring GetActiveTabTitle(int window_index=0); |
408 | 393 |
409 %feature("docstring", "Get the URL for the active tab. for the given or " | 394 %feature("docstring", "Get the URL for the active tab. for the given or " |
410 "first window. Returns an instance of GURL") GetActiveTabURL; | 395 "first window. Returns an instance of GURL") GetActiveTabURL; |
411 GURL GetActiveTabURL(int window_index=0); | 396 GURL GetActiveTabURL(int window_index=0); |
412 | 397 |
413 %feature("docstring", "Count of the number of tabs in the given or " | 398 %feature("docstring", "Count of the number of tabs in the given or " |
414 "first window.") GetTabCount; | 399 "first window.") GetTabCount; |
415 int GetTabCount(int window_index=0); | 400 int GetTabCount(int window_index=0); |
416 %feature("docstring", "Create a new tab at the end of given or first browser " | |
417 "window and activate it. Blocks until the page is loaded. " | |
418 "Returns True on success.") AppendTab; | |
419 bool AppendTab(const GURL& tab_url, int window_index=0); | |
420 | 401 |
421 %feature("docstring", "Set the value of the cookie at cookie_url to value " | 402 %feature("docstring", "Set the value of the cookie at cookie_url to value " |
422 "for the given window index and tab index. " | 403 "for the given window index and tab index. " |
423 "Returns True on success.") SetCookie; | 404 "Returns True on success.") SetCookie; |
424 bool SetCookie(const GURL& cookie_url, const std::string& value, | 405 bool SetCookie(const GURL& cookie_url, const std::string& value, |
425 int window_index=0, int tab_index=0); | 406 int window_index=0, int tab_index=0); |
426 | 407 |
427 %feature("docstring", "Get the value of the cookie at cookie_url for the " | 408 %feature("docstring", "Get the value of the cookie at cookie_url for the " |
428 "given window index and tab index. " | 409 "given window index and tab index. " |
429 "Returns empty string on error or if there is no value for the " | 410 "Returns empty string on error or if there is no value for the " |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 // Initialize a new HTTPSOptions that will use the specified certificate. | 506 // Initialize a new HTTPSOptions that will use the specified certificate. |
526 explicit HTTPSOptions(ServerCertificate cert); | 507 explicit HTTPSOptions(ServerCertificate cert); |
527 }; | 508 }; |
528 | 509 |
529 %{ | 510 %{ |
530 typedef net::TestServer::HTTPSOptions HTTPSOptions; | 511 typedef net::TestServer::HTTPSOptions HTTPSOptions; |
531 %} | 512 %} |
532 | 513 |
533 %pointer_class(int, int_ptr); | 514 %pointer_class(int, int_ptr); |
534 %pointer_class(uint32, uint32_ptr); | 515 %pointer_class(uint32, uint32_ptr); |
OLD | NEW |