diff options
Diffstat (limited to 'o3d/tests')
-rw-r--r-- | o3d/tests/selenium/main.py | 23 | ||||
-rw-r--r-- | o3d/tests/selenium/selenium.gyp | 190 | ||||
-rw-r--r-- | o3d/tests/tests.gyp | 43 |
3 files changed, 252 insertions, 4 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', + ], + }, + }, + ], + }, + ], + ], +} diff --git a/o3d/tests/tests.gyp b/o3d/tests/tests.gyp index 802f636..a8c6766 100644 --- a/o3d/tests/tests.gyp +++ b/o3d/tests/tests.gyp @@ -38,7 +38,6 @@ '../import/archive.gyp:o3dArchiveTest', '../import/import.gyp:o3dImportTest', '../serializer/serializer.gyp:o3dSerializerTest', - '../statsreport/statsreport.gyp:o3dStatsReportTest', '../utils/utils.gyp:o3dUtils', '../utils/utils.gyp:o3dUtilsTest', ], @@ -83,11 +82,30 @@ }, ], 'conditions' : [ + ['renderer == "gl"', + { + 'dependencies': [ + '../build/libs.gyp:cg_libs', + '../build/libs.gyp:gl_libs', + ], + }, + ], ['OS == "mac"', { + 'dependencies': [ + '../statsreport/statsreport.gyp:o3dStatsReportTest', + ], 'sources': [ 'common/mac/testing_common.mm', ], + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)', + 'files': [ + '../../<(pdiffdir)/bin/mac/perceptualdiff', + ], + }, + ], 'include_dirs': [ '../../third_party/glew/files/include', ], @@ -105,10 +123,22 @@ ], ['OS == "win"', { + 'dependencies': [ + '../statsreport/statsreport.gyp:o3dStatsReportTest', + ], 'sources': [ 'common/win/testing_common.cc', 'common/win/testing_common.h', ], + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)', + 'files': [ + '../../<(pdiffdir)/bin/win/perceptualdiff.exe', + '../../<(pdiffdir)/bin/win/FreeImage.dll', + ], + }, + ], 'msvs_settings': { 'VCLinkerTool': { 'AdditionalDependencies': [ @@ -138,7 +168,7 @@ 'common/win/dxcapture.cc', ], 'include_dirs': [ - '$(DXSDK_DIR)/Include', + '"$(DXSDK_DIR)/Include"', ], 'msvs_settings': { 'VCLinkerTool': { @@ -156,8 +186,13 @@ 'sources': [ 'common/linux/testing_common.cc', ], - 'include_dirs': [ - '../../third_party/glew/files/include', + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)', + 'files': [ + '../../<(pdiffdir)/bin/linux/perceptualdiff', + ], + }, ], }, ], |