Chromium Code Reviews| 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 // 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 |
| 11 #include "base/scoped_nsautorelease_pool.h" | 11 #include "base/scoped_nsautorelease_pool.h" |
| 12 #include "chrome/test/ui/ui_test.h" | 12 #include "chrome/test/ui/ui_test.h" |
| 13 #include "chrome/test/ui/ui_test_suite.h" | 13 #include "chrome/test/ui/ui_test_suite.h" |
| 14 | 14 |
| 15 // The C++ style guide forbids using default arguments but I'm taking the | 15 // The C++ style guide forbids using default arguments but I'm taking the |
| 16 // liberty of allowing it in this file. The sole purpose of this (and the | 16 // liberty of allowing it in this file. The sole purpose of this (and the |
| 17 // .cc) is to support the python interface, and default args are allowed in | 17 // .cc) is to support the python interface, and default args are allowed in |
| 18 // python. Strictly adhering to the guide here would mean having to re-define | 18 // python. Strictly adhering to the guide here would mean having to re-define |
| 19 // all methods in python just for the sake of providing default args. This | 19 // all methods in python just for the sake of providing default args. This |
| 20 // seems cumbersome and unwanted. | 20 // seems cumbersome and unwanted. |
| 21 | 21 |
| 22 // TODO(nirnimesh): separate out the UITestSuite and UITestBase parts | 22 // TODO(nirnimesh): separate out the UITestSuite and UITestBase parts |
| 23 // crbug.com/32292 | 23 // crbug.com/32292 |
| 24 | 24 |
| 25 // The primary class that interfaces with Automation Proxy. | 25 // The primary class that interfaces with Automation Proxy. |
| 26 // This class is accessed from python using swig. | 26 // This class is accessed from python using swig. |
| 27 class PyUITestSuite : public UITestSuite, public UITestBase { | 27 class PyUITestSuite : public UITestSuite, public UITestBase { |
| 28 public: | 28 public: |
| 29 // Only public methods are accessible from swig. | 29 // Only public methods are accessible from swig. |
|
John Grabowski
2010/03/17 01:18:56
No need to repeat the doc for variables here, but
| |
| 30 PyUITestSuite(int argc, char** argv); | 30 PyUITestSuite(int argc, char** argv, bool clear_profile, |
| 31 std::wstring homepage); | |
| 31 ~PyUITestSuite(); | 32 ~PyUITestSuite(); |
| 32 | 33 |
| 33 // Initialize the setup. Should be called before launching the browser. | 34 // Initialize the setup. Should be called before launching the browser. |
| 34 // |browser_dir| is the path to dir containing chromium binaries. | 35 // |browser_dir| is the path to dir containing chromium binaries. |
| 35 void Initialize(const FilePath& browser_dir); | 36 void Initialize(const FilePath& browser_dir); |
| 36 | 37 |
| 37 // SetUp,TearDown is redeclared as public to make it accessible from swig. | 38 // SetUp,TearDown is redeclared as public to make it accessible from swig. |
| 38 virtual void SetUp(); | 39 virtual void SetUp(); |
| 39 virtual void TearDown(); | 40 virtual void TearDown(); |
| 40 | 41 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 bool SetBookmarkURL(std::wstring& id, std::wstring& url); | 124 bool SetBookmarkURL(std::wstring& id, std::wstring& url); |
| 124 // Finally, bookmark deletion: | 125 // Finally, bookmark deletion: |
| 125 bool RemoveBookmark(std::wstring& id); | 126 bool RemoveBookmark(std::wstring& id); |
| 126 | 127 |
| 127 private: | 128 private: |
| 128 base::ScopedNSAutoreleasePool pool_; | 129 base::ScopedNSAutoreleasePool pool_; |
| 129 }; | 130 }; |
| 130 | 131 |
| 131 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ | 132 #endif // CHROME_TEST_PYAUTOLIB_PYAUTOLIB_H_ |
| 132 | 133 |
| OLD | NEW |