Index: tests/inbrowser_test_runner/nacl.scons |
diff --git a/tests/inbrowser_test_runner/nacl.scons b/tests/inbrowser_test_runner/nacl.scons |
index 298705b454943b9fb27a9ddf57ba71c66a77f790..504e73bbb6940e50ccb638cf4dda9c0ca5f3c6e0 100644 |
--- a/tests/inbrowser_test_runner/nacl.scons |
+++ b/tests/inbrowser_test_runner/nacl.scons |
@@ -30,45 +30,48 @@ if (env.Bit('nacl_static_link') and |
if not env.Bit('target_arm'): |
exe_list.append('dynamic_modify_browser_test') |
-# Exception handling support is not implemented everywhere yet. |
-if (not env.Bit('disable_dynamic_plugin_loading') and |
- not (env.Bit('host_windows') and env.Bit('build_x86_64'))): |
- exe_list.append('exception_browser_test') |
- env['ENV']['NACL_UNTRUSTED_EXCEPTION_HANDLING'] = '1' |
- |
- |
-test_files = ([env.File('${STAGING_DIR}/nacltest.js')] + |
- [env.File('${STAGING_DIR}/%s_${TARGET_FULLARCH}${PROGSUFFIX}' |
- % exe_name) |
- for exe_name in exe_list]) |
-# These are not true dependencies: They are not needed for |
-# test_runner.html to be replicated to "staging", but they are needed |
-# for test_runner.html to work when run. |
-env.Depends(dest_copy, test_files) |
-env.Alias('test_runner.html', dest_copy) |
- |
-def WriteManifestList(target, source, env): |
- nmf_names = ['%s.nmf' % exe_name for exe_name in exe_list] |
- data = ('// This file is automatically generated\n' |
- 'var G_NMF_TEST_LIST = %s;\n' % json.dumps(nmf_names)) |
- fh = open(target[0].abspath, 'w') |
- fh.write(data) |
- fh.close() |
- |
-nmf_list_js = env.Command(['nmf_test_list.js'], [], WriteManifestList)[0] |
-# Scons does not track the dependency of nmf_list_js on exe_list, so |
-# we must always recreate nmf_list_js when it is used. |
-env.AlwaysBuild(nmf_list_js) |
- |
-node = env.PPAPIBrowserTester( |
- 'inbrowser_test_runner.out', url='test_runner.html', |
- nmf_names=exe_list, |
- files=[env.File('test_runner.html'), nmf_list_js] + test_files) |
- |
-# Disabled on Valgrind because of multiple nexes. |
-# TODO(eugenis): enable when Valgrind learns to autodetect the nexe name |
-env.AddNodeToTestSuite(node, ['chrome_browser_tests'], |
- 'run_inbrowser_test_runner', |
- is_broken=env.PPAPIBrowserTesterIsBroken() or |
- env.Bit('running_on_valgrind') or |
- not env.Bit('irt')) |
+ |
+def AddTest(env, test_name, exe_list): |
+ test_files = [env.File('${STAGING_DIR}/%s_${TARGET_FULLARCH}${PROGSUFFIX}' |
+ % exe_name) |
+ for exe_name in exe_list] |
+ |
+ def WriteManifestList(target, source, env): |
+ nmf_names = ['%s.nmf' % exe_name for exe_name in exe_list] |
+ data = ('// This file is automatically generated\n' |
+ 'var G_NMF_TEST_LIST = %s;\n' % json.dumps(nmf_names)) |
+ fh = open(target[0].abspath, 'w') |
+ fh.write(data) |
+ fh.close() |
+ |
+ nmf_list_js = env.Command(['%s_nmf_test_list.js' % test_name], [], |
+ WriteManifestList)[0] |
+ # Scons does not track the dependency of nmf_list_js on exe_list, so |
+ # we must always recreate nmf_list_js when it is used. |
+ env.AlwaysBuild(nmf_list_js) |
+ |
+ node = env.PPAPIBrowserTester( |
+ '%s.out' % test_name, url='test_runner.html', |
+ nmf_names=exe_list, |
+ files=[env.File('test_runner.html')] + test_files, |
+ map_files=[('nmf_test_list.js', nmf_list_js)]) |
+ |
+ # Disabled on Valgrind because of multiple nexes. |
+ # TODO(eugenis): enable when Valgrind learns to autodetect the nexe name |
+ env.AddNodeToTestSuite(node, ['chrome_browser_tests'], test_name, |
+ is_broken=env.PPAPIBrowserTesterIsBroken() or |
+ env.Bit('running_on_valgrind') or |
+ not env.Bit('irt')) |
+ |
+ |
+AddTest(env, 'run_inbrowser_test_runner', exe_list) |
+ |
+# "exception_test" is added as a separate test so that it can be |
+# separately enabled or disabled from the Chromium side. |
+# TODO(mseaborn): When this test works fully in Chromium on all OSes, |
+# merge this back into run_inbrowser_test_runner. |
+# See http://code.google.com/p/nativeclient/issues/detail?id=2602 |
+exception_env = env.Clone() |
+exception_env['ENV']['NACL_UNTRUSTED_EXCEPTION_HANDLING'] = '1' |
+AddTest(exception_env, 'run_inbrowser_exception_test', |
+ ['exception_browser_test']) |