Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Unified Diff: chrome/test/pyautolib/pyauto.py

Issue 1007007: PyAuto: Flags to forbid cleaning profile dir... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyautolib.h » ('j') | chrome/test/pyautolib/pyautolib.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/pyauto.py
===================================================================
--- chrome/test/pyautolib/pyauto.py (revision 41456)
+++ chrome/test/pyautolib/pyauto.py (working copy)
@@ -68,7 +68,7 @@
self.assertTrue("Google" == self.GetActiveTabTitle())
"""
- def __init__(self, methodName='runTest', extra_chrome_flags=None):
+ def __init__(self, methodName='runTest', **kwargs):
"""Initialize PyUITest.
When redefining __init__ in a derived class, make sure that:
@@ -77,12 +77,24 @@
Args:
methodName: the default method name. Internal use by unittest module
- extra_chrome_flags: additional flags to pass when launching chrome
+
+ (The rest of the args can be in any order. They can even be skipped in
+ which case the defaults will be used.)
+
+ extra_chrome_flags: additional flags to pass when launching chrome.
+ Defaults to None
+ clear_profile: If True, clean the profile dir before use. Defaults to True
+ homepage: the home page. Defaults to "about:blank"
"""
+ # Fetch provided keyword args, or fill in defaults.
+ extra_chrome_flags = kwargs.get('extra_chrome_flags')
+ clear_profile = kwargs.get('clear_profile', True)
+ homepage = kwargs.get('homepage', 'about:blank')
+
args = sys.argv
if extra_chrome_flags is not None:
John Grabowski 2010/03/17 01:18:56 "if extra chrome flags:" (no need for "is not None
args.append('--extra-chrome-flags=%s' % extra_chrome_flags)
- pyautolib.PyUITestSuite.__init__(self, args)
+ pyautolib.PyUITestSuite.__init__(self, args, clear_profile, homepage)
# Figure out path to chromium binaries
browser_dir = os.path.normpath(os.path.dirname(pyautolib.__file__))
os.environ['PATH'] = browser_dir + os.pathsep + os.environ['PATH']
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyautolib.h » ('j') | chrome/test/pyautolib/pyautolib.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698