summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r--chrome/test/pyautolib/pyauto.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index 42b4b38..0224c8f 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -164,6 +164,11 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
def tearDown(self):
self.TearDown() # Destroy browser
+ @staticmethod
+ def CloseChromeOnChromeOS():
+ """Gracefully exit chrome on ChromeOS."""
+ subprocess.call(['pkill', 'chrome'])
+
def EnableChromeTestingOnChromeOS(self):
"""Enables the named automation interface on chromeos.
@@ -224,6 +229,15 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
Defaults to True, that is restarts browser with a clean
profile.
"""
+ if self.IsChromeOS():
+ self.TearDown()
+ if clear_profile:
+ self.CleanupBrowserProfileOnChromeOS()
+ self.CloseChromeOnChromeOS()
+ self.EnableChromeTestingOnChromeOS()
+ self.SetUp()
+ return
+ # Not chromeos
orig_clear_state = self.get_clear_profile()
self.CloseBrowserAndServer()
self.set_clear_profile(clear_profile)