diff options
author | gspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 17:25:00 +0000 |
---|---|---|
committer | gspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 17:25:00 +0000 |
commit | 37a625a6cefff0972bc95d2add8a797a37dbb3f9 (patch) | |
tree | 43e4b5f31e2d44b6a456fee666b3988d4b2f212d /o3d/tests/selenium | |
parent | e6060447254932d459c6c6fa6061c11a01432c7d (diff) | |
download | chromium_src-37a625a6cefff0972bc95d2add8a797a37dbb3f9.zip chromium_src-37a625a6cefff0972bc95d2add8a797a37dbb3f9.tar.gz chromium_src-37a625a6cefff0972bc95d2add8a797a37dbb3f9.tar.bz2 |
This adds in targets for selenium and updated several other problems,
including some problems with the samples and idl generation.
Selenium targets launch selenium on all platforms, but the tests don't
pass anywhere but Windows yet because the plugin isn't found.
I'll work on that next.
Review URL: http://codereview.chromium.org/197014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/tests/selenium')
-rw-r--r-- | o3d/tests/selenium/main.py | 23 | ||||
-rw-r--r-- | o3d/tests/selenium/selenium.gyp | 190 |
2 files changed, 213 insertions, 0 deletions
diff --git a/o3d/tests/selenium/main.py b/o3d/tests/selenium/main.py index b421659..bf4e9a8 100644 --- a/o3d/tests/selenium/main.py +++ b/o3d/tests/selenium/main.py @@ -992,6 +992,21 @@ def main(unused_argv): # Return error code 1. return 1 +def GetChromePath(): + value = None + if sys.platform == "win32" or sys.platform == "cygwin": + import _winreg + try: + key = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, + "Applications\\chrome.exe\\shell\\open\\command") + (value, type) = _winreg.QueryValueEx(key, None) + _winreg.CloseKey(key) + except WindowsError: + raise Exception("Unable to determine location for Chrome -- " + "it is installed?") + value = os.path.dirname(value) + return value + if __name__ == "__main__": remaining_argv = FLAGS(sys.argv) @@ -999,6 +1014,14 @@ if __name__ == "__main__": os.environ["MOZ_CRASHREPORTER_DISABLE"] = "1" os.environ["MOZ_PLUGIN_PATH"] = os.path.normpath(FLAGS.product_dir) + # Setup the path for chrome. + chrome_path = GetChromePath() + if chrome_path: + if os.environ.get("PATH"): + os.environ["PATH"] = os.pathsep.join([os.environ["PATH"], chrome_path]) + else: + os.environ["PATH"] = chrome_path + # Setup the LD_LIBRARY_PATH on Linux. if sys.platform[:5] == "linux": if os.environ.get("LD_LIBRARY_PATH"): diff --git a/o3d/tests/selenium/selenium.gyp b/o3d/tests/selenium/selenium.gyp new file mode 100644 index 0000000..b9aa09f --- /dev/null +++ b/o3d/tests/selenium/selenium.gyp @@ -0,0 +1,190 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + 'chromium_code': 1, + 'selenium_args': [ + '--referencedir=<(screenshotsdir)', + '--product_dir=<(PRODUCT_DIR)', + '--screencompare=<(PRODUCT_DIR)/perceptualdiff<(EXECUTABLE_SUFFIX)', + ], + }, + 'includes': [ + '../../build/common.gypi', + ], + 'targets': [ + { + 'target_name': 'install_selenium_tests', + 'type': 'none', + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/tests/selenium/tests', + 'files': [ + 'tests/base-test.html', + 'tests/culling-zsort-test.html', + 'tests/drawshapes.html', + 'tests/effect-import-test.html', + 'tests/event-test.html', + 'tests/features-test.html', + 'tests/init-status-test.html', + 'tests/math-test.html', + 'tests/no-rendergraph.html', + 'tests/non-cachable-params.html', + 'tests/offscreen-test.html', + 'tests/ownership-test.html', + 'tests/param-array-test.html', + 'tests/pixel-perfection.html', + 'tests/quaternion-test.html', + 'tests/render-test.html', + 'tests/serialization-test.html', + 'tests/test-test.html', + 'tests/texture-set-test.html', + 'tests/type-test.html', + 'tests/util-test.html', + 'tests/v8-test.html', + 'tests/version-check-test.html', + 'tests/window-overlap-test.html', + 'tests/window-overlap-top.html', + ], + }, + { + 'destination': '<(PRODUCT_DIR)/tests/selenium/tests/assets', + 'files': [ + 'tests/assets/archive.o3dtgz', + ], + }, + ] + }, + { + 'target_name': 'selenium_firefox', + 'type': 'none', + 'dependencies': [ + 'install_selenium_tests', + '../tests.gyp:unit_tests', + '../../plugin/plugin.gyp:npo3dautoplugin', + ], + 'scons_propagate_variables': [ + 'HOME', + 'DISPLAY', + 'XAUTHORITY', + ], + 'run_as': { + 'working_directory': '<(DEPTH)', + 'action': [ + 'python<(EXECUTABLE_SUFFIX)', + 'o3d/tests/selenium/main.py', + '<@(selenium_args)', + '--browser=*firefox', + '--screenshotsdir=<(PRODUCT_DIR)/tests/selenium/screenshots_firefox', + ], + }, + }, + { + 'target_name': 'selenium_chrome', + 'type': 'none', + 'dependencies': [ + 'install_selenium_tests', + '../tests.gyp:unit_tests', + '../../plugin/plugin.gyp:npo3dautoplugin', + ], + 'scons_propagate_variables': [ + 'HOME', + 'DISPLAY', + 'XAUTHORITY', + ], + 'run_as': { + 'action': [ + 'python<(EXECUTABLE_SUFFIX)', + 'main.py', + '<@(selenium_args)', + '--browser=*googlechrome', + '--screenshotsdir=<(PRODUCT_DIR)/tests/selenium/screenshots_chrome', + ], + }, + 'conditions': [ + ['OS=="linux"', + { + 'variables': { + 'selenium_args': [ + '--browserpath=/usr/bin/google-chrome', + ], + }, + }, + ], + ['OS=="mac"', + { + 'variables': { + 'selenium_args': [ + '--browserpath="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"', + ], + }, + }, + ], + ], + }, + ], + 'conditions': [ + ['<(selenium_screenshots) == 1', + { + 'variables': { + 'selenium_args': [ + '--screenshots', + ], + }, + }, + ], + ['OS=="mac"', + { + 'targets': [ + { + 'target_name': 'selenium_safari', + 'type': 'none', + 'dependencies': [ + 'install_selenium_tests', + '../tests.gyp:unit_tests', + '../../plugin/plugin.gyp:npo3dautoplugin', + ], + 'run_as': { + 'action': [ + 'python<(EXECUTABLE_SUFFIX)', + 'main.py', + '<@(selenium_args)', + '--browser=*safari', + '--screenshotsdir=<(PRODUCT_DIR)/tests/selenium/screenshots_safari', + ], + }, + }, + ], + }, + ], + ['OS=="win"', + { + 'targets': [ + { + 'target_name': 'selenium_ie', + 'type': 'none', + 'dependencies': [ + 'install_selenium_tests', + '../tests.gyp:unit_tests', + '../../plugin/plugin.gyp:npo3dautoplugin', + '../../plugin/plugin.gyp:o3d_host', + '../../plugin/plugin.gyp:o3d_host_register', + ], + 'run_as': { + 'action': [ + 'python<(EXECUTABLE_SUFFIX)', + 'main.py', + '<@(selenium_args)', + '--servertimeout=80', + '--browser=*iexplore', + '--screenshotsdir=<(PRODUCT_DIR)/tests/selenium/screenshots_ie', + ], + }, + }, + ], + }, + ], + ], +} |