diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-23 23:39:51 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-23 23:39:51 +0000 |
commit | 3f5d5837c8187216a92c5a2c4c171ceeccf54358 (patch) | |
tree | b608db6ea4d2356818628f6c76bc54e79cfd6f47 /chrome/test | |
parent | 9e9e842e287f9f949aa59bcf88321fa7f94fd524 (diff) | |
download | chromium_src-3f5d5837c8187216a92c5a2c4c171ceeccf54358.zip chromium_src-3f5d5837c8187216a92c5a2c4c171ceeccf54358.tar.gz chromium_src-3f5d5837c8187216a92c5a2c4c171ceeccf54358.tar.bz2 |
Support test inclusions/exclusions for PyAuto tests on ChromeOS
Review URL: http://codereview.chromium.org/3005028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/functional/PYAUTO_TESTS | 9 | ||||
-rw-r--r-- | chrome/test/pyautolib/PYAUTO_TESTS | 3 | ||||
-rw-r--r-- | chrome/test/pyautolib/pyauto.py | 23 |
3 files changed, 31 insertions, 4 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS index 1e16df7..f69c16b 100644 --- a/chrome/test/functional/PYAUTO_TESTS +++ b/chrome/test/functional/PYAUTO_TESTS @@ -52,11 +52,16 @@ '-passwords', ], - 'linux': [ + 'linux': [ # linux != chromeos '-omnibox', # http://crbug.com/44203 '-browser.BrowserTest.testWindowResize', # crbug.com/44963 '-content.ContentTest.testThreeWindows', # crbug.com/47457 ], - # TODO(nirnimesh): Add a ChromeOS section + # ChromeOS is linux, but note that this section does not include the + # entries in the linux section above. + 'chromeos': [ + # you cannot resize browser window on chromeos + '-browser.BrowserTest.testWindowResize', + ], } diff --git a/chrome/test/pyautolib/PYAUTO_TESTS b/chrome/test/pyautolib/PYAUTO_TESTS index dd43331..c4d4e2a 100644 --- a/chrome/test/pyautolib/PYAUTO_TESTS +++ b/chrome/test/pyautolib/PYAUTO_TESTS @@ -14,4 +14,7 @@ 'linux': [ ], + + 'chromeos': [ + ], } diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py index 5394752..716f14d 100644 --- a/chrome/test/pyautolib/pyauto.py +++ b/chrome/test/pyautolib/pyauto.py @@ -189,7 +189,7 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): @staticmethod def IsLinux(): - """Are we on Linux?""" + """Are we on Linux? ChromeOS is linux too.""" return 'linux2' == sys.platform @staticmethod @@ -198,6 +198,20 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): return 'win32' == sys.platform @staticmethod + def IsChromeOS(): + """Are we on ChromeOS (or Chromium OS)? + + Checks for "CHROMEOS_RELEASE_NAME=" in /etc/lsb-release. + """ + lsb_release = '/etc/lsb-release' + if not PyUITest.IsLinux() or not os.path.isfile(lsb_release): + return False + for line in open(lsb_release).readlines(): + if line.startswith('CHROMEOS_RELEASE_NAME='): + return True + return False + + @staticmethod def IsPosix(): """Are we on Mac/Linux?""" return PyUITest.IsMac() or PyUITest.IsLinux() @@ -1003,6 +1017,7 @@ class Main(object): 'win32': 'win', 'darwin': 'mac', 'linux2': 'linux', + 'chromeos': 'chromeos', } def __init__(self): @@ -1174,8 +1189,12 @@ class Main(object): def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) + platform = sys.platform + if PyUITest.IsChromeOS(): # check if it's chromeos + platform = 'chromeos' + assert platform in self._platform_map, '%s unsupported' % platform all_names = modules.get('all', []) + \ - modules.get(self._platform_map[sys.platform], []) + modules.get(self._platform_map[platform], []) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. |