diff options
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/functional/prefs.py | 10 | ||||
-rw-r--r-- | chrome/test/pyautolib/pyauto.py | 20 |
2 files changed, 27 insertions, 3 deletions
diff --git a/chrome/test/functional/prefs.py b/chrome/test/functional/prefs.py index 3b788ee..39e00a4 100644 --- a/chrome/test/functional/prefs.py +++ b/chrome/test/functional/prefs.py @@ -6,6 +6,7 @@ import logging import os import shutil +import sys import pyauto_functional # Must be imported before pyauto import pyauto @@ -109,12 +110,15 @@ class PrefsTest(pyauto.PyUITest): """Verify toolbar buttons prefs..""" # Assert defaults first self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton)) - self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kShowPageOptionsButtons)) self.SetPrefs(pyauto.kShowHomeButton, True) - self.SetPrefs(pyauto.kShowPageOptionsButtons, True) + if self.IsMac(): # win/linux don't have the + self.assertFalse( # "browser.show_page_options_buttons" pref + self.GetPrefsInfo().Prefs(pyauto.kShowPageOptionsButtons)) + self.SetPrefs(pyauto.kShowPageOptionsButtons, True) self.RestartBrowser(clear_profile=False) self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton)) - self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kShowPageOptionsButtons)) + if self.IsMac(): + self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kShowPageOptionsButtons)) def testHomepagePrefs(self): """Verify homepage prefs.""" diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py index fb23190..045b8b1 100644 --- a/chrome/test/pyautolib/pyauto.py +++ b/chrome/test/pyautolib/pyauto.py @@ -179,6 +179,26 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): quoted_path = urllib.quote(abs_path) return 'file://' + quoted_path + @staticmethod + def IsMac(): + """Are we on Mac?""" + return 'darwin' == sys.platform + + @staticmethod + def IsLinux(): + """Are we on Linux?""" + return 'linux2' == sys.platform + + @staticmethod + def IsWin(): + """Are we on Win?""" + return 'win32' == sys.platform + + @staticmethod + def IsPosix(): + """Are we on Mac/Linux?""" + return PyUITest.IsMac() or PyUITest.IsLinux() + def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]): """Poll on a condition until timeout. |