From b94724ed2d21cae98a0f15ae35a23ae45898b4b7 Mon Sep 17 00:00:00 2001 From: "nirnimesh@chromium.org" Date: Wed, 17 Mar 2010 21:04:18 +0000 Subject: PyAuto: Flags to forbid cleaning profile dir Several tests require quitting/killing chromium to test features like restore. In addition, one might want to use pyauto on an existing profile. This CL lets pyauto work without cleaning the profile dir. Also lets specify the homepage to use. Example: Running this test with CHROME_UI_TESTS_USER_DATA_DIR pointing to a profile dir will run my script with the given dir as the user-data-dir without cleaning it up, and also specifies the homepage to use. class A(PyUITest): def __init__(self, methodName): PyUITest.__init__(self, methodName, clear_profile=False, homepage="http://www.cnn.com") def testA(self): pass BUG=None TEST=None Review URL: http://codereview.chromium.org/1007007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41878 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/ui/ui_test.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'chrome/test/ui') diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 56c7e9c..334e8b2 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -435,6 +435,18 @@ class UITestBase { ui_test_name_ = name; } + // Sets clear_profile_. Should be called before launching browser to have + // any effect. + void set_clear_profile(bool clear_profile) { + clear_profile_ = clear_profile; + } + + // Sets homepage_. Should be called before launching browser to have + // any effect. + void set_homepage(const std::wstring& homepage) { + homepage_ = homepage; + } + // Count the number of active browser processes launched by this test. // The count includes browser sub-processes. int GetBrowserProcessCount(); -- cgit v1.1