| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 class PyUITestBase { | 175 class PyUITestBase { |
| 176 public: | 176 public: |
| 177 PyUITestBase(bool clear_profile, std::wstring homepage); | 177 PyUITestBase(bool clear_profile, std::wstring homepage); |
| 178 | 178 |
| 179 %feature("docstring", "Initialize the entire setup. Should be called " | 179 %feature("docstring", "Initialize the entire setup. Should be called " |
| 180 "before launching the browser. For internal use.") Initialize; | 180 "before launching the browser. For internal use.") Initialize; |
| 181 void Initialize(const FilePath& browser_dir); | 181 void Initialize(const FilePath& browser_dir); |
| 182 | 182 |
| 183 void UseNamedChannelID(const std::string& named_channel_id); |
| 184 |
| 183 %feature("docstring", | 185 %feature("docstring", |
| 184 "Fires up the browser and opens a window.") SetUp; | 186 "Fires up the browser and opens a window.") SetUp; |
| 185 virtual void SetUp(); | 187 virtual void SetUp(); |
| 186 %feature("docstring", | 188 %feature("docstring", |
| 187 "Closes all windows and destroys the browser.") TearDown; | 189 "Closes all windows and destroys the browser.") TearDown; |
| 188 virtual void TearDown(); | 190 virtual void TearDown(); |
| 189 | 191 |
| 190 %feature("docstring", "Timeout (in milli secs) for an action. " | 192 %feature("docstring", "Timeout (in milli secs) for an action. " |
| 191 "This value is also used as default for the WaitUntil() method.") | 193 "This value is also used as default for the WaitUntil() method.") |
| 192 action_max_timeout_ms; | 194 action_max_timeout_ms; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 364 |
| 363 %feature("docstring", "Get a proxy to the browser window at the given " | 365 %feature("docstring", "Get a proxy to the browser window at the given " |
| 364 "zero-based index.") GetBrowserWindow; | 366 "zero-based index.") GetBrowserWindow; |
| 365 scoped_refptr<BrowserProxy> GetBrowserWindow(int window_index); | 367 scoped_refptr<BrowserProxy> GetBrowserWindow(int window_index); |
| 366 | 368 |
| 367 // Meta-method | 369 // Meta-method |
| 368 %feature("docstring", "Send a sync JSON request to Chrome. " | 370 %feature("docstring", "Send a sync JSON request to Chrome. " |
| 369 "Returns a JSON dict as a response. " | 371 "Returns a JSON dict as a response. " |
| 370 "Internal method.") | 372 "Internal method.") |
| 371 _SendJSONRequest; | 373 _SendJSONRequest; |
| 372 std::string _SendJSONRequest(int window_index, std::string request); | 374 std::string _SendJSONRequest(int window_index, const std::string& request); |
| 373 | 375 |
| 374 %feature("docstring", "Execute a string of javascript in the specified " | 376 %feature("docstring", "Execute a string of javascript in the specified " |
| 375 "(window, tab, frame) and return a string.") ExecuteJavascript; | 377 "(window, tab, frame) and return a string.") ExecuteJavascript; |
| 376 std::wstring ExecuteJavascript(const std::wstring& script, | 378 std::wstring ExecuteJavascript(const std::wstring& script, |
| 377 int window_index=0, | 379 int window_index=0, |
| 378 int tab_index=0, | 380 int tab_index=0, |
| 379 const std::wstring& frame_xpath=""); | 381 const std::wstring& frame_xpath=""); |
| 380 | 382 |
| 381 %feature("docstring", "Evaluate a javascript expression in the specified " | 383 %feature("docstring", "Evaluate a javascript expression in the specified " |
| 382 "(window, tab, frame) and return the specified DOM value " | 384 "(window, tab, frame) and return the specified DOM value " |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 %feature("docstring", "Get FilePath to the document root") document_root; | 420 %feature("docstring", "Get FilePath to the document root") document_root; |
| 419 const FilePath& document_root() const; | 421 const FilePath& document_root() const; |
| 420 | 422 |
| 421 std::string GetScheme() const; | 423 std::string GetScheme() const; |
| 422 | 424 |
| 423 %feature("docstring", "Get URL for a file path") GetURL; | 425 %feature("docstring", "Get URL for a file path") GetURL; |
| 424 GURL GetURL(const std::string& path) const; | 426 GURL GetURL(const std::string& path) const; |
| 425 }; | 427 }; |
| 426 } | 428 } |
| 427 | 429 |
| OLD | NEW |