diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-26 18:21:14 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-26 18:21:14 +0000 |
commit | 6fe4c140055067aefca1b5dab1a1fb2703830c62 (patch) | |
tree | d3899da7800981b1eae1e8625b5b32de10475edc /chrome/test/pyautolib | |
parent | 1e100b35908cc1ac6320dfe878b2a43a6b94c00a (diff) | |
download | chromium_src-6fe4c140055067aefca1b5dab1a1fb2703830c62.zip chromium_src-6fe4c140055067aefca1b5dab1a1fb2703830c62.tar.gz chromium_src-6fe4c140055067aefca1b5dab1a1fb2703830c62.tar.bz2 |
Add tests for history.
Tests various scenarios with chromium history.
testHistoryPersists, testInvalidURLNoHistory -- by Srikanth.
testNewTabNoHistory, testIncognitoNoHistory, testStarredBookmarkInHistory,
testHistorySearchSnippet -- by Ismail.
testNavigateMultiTimes, testMultiTabsWindowsHistory -- by Rohit.
TEST=python chrome/test/functional/history.py
Review URL: http://codereview.chromium.org/1745012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r-- | chrome/test/pyautolib/pyauto.py | 18 | ||||
-rw-r--r-- | chrome/test/pyautolib/pyautolib.i | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py index 164e3e9..4575a73 100644 --- a/chrome/test/pyautolib/pyauto.py +++ b/chrome/test/pyautolib/pyauto.py @@ -135,6 +135,24 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): def tearDown(self): self.TearDown() # Destroy browser + def RestartBrowser(self, clear_profile=True): + """Restart the browser. + + For use with tests that require to restart the browser. + + Args: + clear_profile: If True, the browser profile is cleared before restart. + Defaults to True, that is restarts browser with a clean + profile. + """ + orig_clear_state = self.get_clear_profile() + self.CloseBrowserAndServer() + self.set_clear_profile(clear_profile) + logging.debug('Restarting browser with clear_profile=%s' % + self.get_clear_profile()) + self.LaunchBrowserAndServer() + self.set_clear_profile(orig_clear_state) # Reset to original state. + @staticmethod def DataDir(): """Returns the path to the data dir chrome/test/data.""" diff --git a/chrome/test/pyautolib/pyautolib.i b/chrome/test/pyautolib/pyautolib.i index e974319..7156df6 100644 --- a/chrome/test/pyautolib/pyautolib.i +++ b/chrome/test/pyautolib/pyautolib.i @@ -191,6 +191,9 @@ class PyUITestBase { CloseBrowserAndServer; void CloseBrowserAndServer(); + %feature("docstring", "Determine if the profile is set to be cleared on " + "next startup.") get_clear_profile; + bool get_clear_profile() const; %feature("docstring", "If False, sets the flag so that the profile is " "not cleared on next startup. Useful for persisting profile " "across restarts. By default the state is True, to clear profile.") |