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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 %feature("docstring", "Open a new browser window.") OpenNewBrowserWindow; | 372 %feature("docstring", "Open a new browser window.") OpenNewBrowserWindow; |
388 bool OpenNewBrowserWindow(bool show); | 373 bool OpenNewBrowserWindow(bool show); |
389 | 374 |
390 %feature("docstring", "Close a browser window.") CloseBrowserWindow; | 375 %feature("docstring", "Close a browser window.") CloseBrowserWindow; |
391 bool CloseBrowserWindow(int window_index); | 376 bool CloseBrowserWindow(int window_index); |
392 | 377 |
393 %feature("docstring", "Fetch the number of browser windows. Includes popups.") | 378 %feature("docstring", "Fetch the number of browser windows. Includes popups.") |
394 GetBrowserWindowCount; | 379 GetBrowserWindowCount; |
395 int GetBrowserWindowCount(); | 380 int GetBrowserWindowCount(); |
396 | 381 |
397 %feature("docstring", "Get the index of the active tab in the given or " | |
398 "first window. Indexes are zero-based.") GetActiveTabIndex; | |
399 int GetActiveTabIndex(int window_index=0); | |
400 %feature("docstring", "Activate the tab at the given zero-based index in " | 382 %feature("docstring", "Activate the tab at the given zero-based index in " |
401 "the given or first window. Also brings the window to the front. " | 383 "the given or first window. Also brings the window to the front. " |
402 "Returns True on success.") ActivateTab; | 384 "Returns True on success.") ActivateTab; |
403 bool ActivateTab(int tab_index, int window_index=0); | 385 bool ActivateTab(int tab_index, int window_index=0); |
404 | 386 |
405 %feature("docstring", "Get the title of the active tab for the given or " | 387 %feature("docstring", "Get the title of the active tab for the given or " |
406 "first window.") GetActiveTabTitle; | 388 "first window.") GetActiveTabTitle; |
407 std::wstring GetActiveTabTitle(int window_index=0); | 389 std::wstring GetActiveTabTitle(int window_index=0); |
408 | 390 |
409 %feature("docstring", "Get the URL for the active tab. for the given or " | 391 %feature("docstring", "Get the URL for the active tab. for the given or " |
410 "first window. Returns an instance of GURL") GetActiveTabURL; | 392 "first window. Returns an instance of GURL") GetActiveTabURL; |
411 GURL GetActiveTabURL(int window_index=0); | 393 GURL GetActiveTabURL(int window_index=0); |
412 | 394 |
413 %feature("docstring", "Count of the number of tabs in the given or " | 395 %feature("docstring", "Count of the number of tabs in the given or " |
414 "first window.") GetTabCount; | 396 "first window.") GetTabCount; |
415 int GetTabCount(int window_index=0); | 397 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 | 398 |
421 %feature("docstring", "Set the value of the cookie at cookie_url to value " | 399 %feature("docstring", "Set the value of the cookie at cookie_url to value " |
422 "for the given window index and tab index. " | 400 "for the given window index and tab index. " |
423 "Returns True on success.") SetCookie; | 401 "Returns True on success.") SetCookie; |
424 bool SetCookie(const GURL& cookie_url, const std::string& value, | 402 bool SetCookie(const GURL& cookie_url, const std::string& value, |
425 int window_index=0, int tab_index=0); | 403 int window_index=0, int tab_index=0); |
426 | 404 |
427 %feature("docstring", "Get the value of the cookie at cookie_url for the " | 405 %feature("docstring", "Get the value of the cookie at cookie_url for the " |
428 "given window index and tab index. " | 406 "given window index and tab index. " |
429 "Returns empty string on error or if there is no value for the " | 407 "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. | 503 // Initialize a new HTTPSOptions that will use the specified certificate. |
526 explicit HTTPSOptions(ServerCertificate cert); | 504 explicit HTTPSOptions(ServerCertificate cert); |
527 }; | 505 }; |
528 | 506 |
529 %{ | 507 %{ |
530 typedef net::TestServer::HTTPSOptions HTTPSOptions; | 508 typedef net::TestServer::HTTPSOptions HTTPSOptions; |
531 %} | 509 %} |
532 | 510 |
533 %pointer_class(int, int_ptr); | 511 %pointer_class(int, int_ptr); |
534 %pointer_class(uint32, uint32_ptr); | 512 %pointer_class(uint32, uint32_ptr); |
OLD | NEW |