diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 00:58:00 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 00:58:00 +0000 |
commit | 3e50576e9fb97b64f2971171b8b96e62296eb23b (patch) | |
tree | 990c7817172ed70875c06bb669a6f070d7e463c3 /chrome/test | |
parent | 7096068e5428d7981edfc7ad959238917af0657d (diff) | |
download | chromium_src-3e50576e9fb97b64f2971171b8b96e62296eb23b.zip chromium_src-3e50576e9fb97b64f2971171b8b96e62296eb23b.tar.gz chromium_src-3e50576e9fb97b64f2971171b8b96e62296eb23b.tar.bz2 |
Fix a pref test -- Win/Linux don't have browser.show_page_options_buttons pref
TEST=python chrome/test/functional/prefs.py prefs.PrefsTest.testToolbarButtonsPref
Review URL: http://codereview.chromium.org/2117009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47481 0039d316-1c4b-4281-b951-d872f2087c98
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. |