diff options
author | halyavin@chromium.org <halyavin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-08 00:38:11 +0000 |
---|---|---|
committer | halyavin@chromium.org <halyavin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-08 00:38:11 +0000 |
commit | da06fd2971af93dd31a6963afb1bb72b73f16079 (patch) | |
tree | b30403e27447fc3d31059f5307af6c7a2279c604 | |
parent | 44e4e1a420496ae836cd89c2c62d40be904a4793 (diff) | |
download | chromium_src-da06fd2971af93dd31a6963afb1bb72b73f16079.zip chromium_src-da06fd2971af93dd31a6963afb1bb72b73f16079.tar.gz chromium_src-da06fd2971af93dd31a6963afb1bb72b73f16079.tar.bz2 |
Porting ppapi_bad NaCl test to glibc.
Needs DEPS update (rev 6762) for testing.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=2191
TEST= ./scons -j16 --mode=dbg-host,nacl platform=x86-64 run_ppapi_bad_native_test
Review URL: http://codereview.chromium.org/8017004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104616 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 78 insertions, 20 deletions
diff --git a/ppapi/native_client/tests/ppapi_browser/bad/nacl.scons b/ppapi/native_client/tests/ppapi_browser/bad/nacl.scons index bae23f4..b5cb354 100644 --- a/ppapi/native_client/tests/ppapi_browser/bad/nacl.scons +++ b/ppapi/native_client/tests/ppapi_browser/bad/nacl.scons @@ -76,28 +76,48 @@ env.AddNodeToTestSuite(node, # Bad nexe tests that won't work in PNaCl (native) # For example, partly_invalid.nexe has inline assembly in its source files. -ppapi_bad_native_files = [ - env.File('ppapi_bad_native.html'), - env.File('${SCONSTRUCT_DIR}/tests/ppapi_browser/progress_events/' + - 'ppapi_progress_events.js'), - env.File('${SCONSTRUCT_DIR}/tools/browser_tester/browserdata/nacltest.js') - ] -replicated_files = env.Replicate('${STAGING_DIR}', ppapi_bad_native_files) -env.Alias('all_programs', replicated_files) - +nacltest_js = env.File('${SCONSTRUCT_DIR}/tools/browser_tester/browserdata/' + + 'nacltest.js') partly_invalid = env.File('${STAGING_DIR}/partly_invalid${PROGSUFFIX}') -ppapi_bad_native_files.append(partly_invalid) +nmf = '${TEST_DIR}/partly_invalid.nmf' +if not env.Bit('nacl_glibc'): + ppapi_bad_native_files = [ + env.File('ppapi_bad_native.html'), + env.File('${SCONSTRUCT_DIR}/tests/ppapi_browser/progress_events/' + + 'ppapi_progress_events.js'), + nacltest_js] + replicated_files = env.Replicate('${STAGING_DIR}', ppapi_bad_native_files) + env.Alias('all_programs', replicated_files) + ppapi_bad_native_files.append(partly_invalid) -node = env.PPAPIBrowserTester( - 'ppapi_bad_native_test.out', - url='ppapi_bad_native.html', - nmfs=['${TEST_DIR}/partly_invalid.nmf'], - files=ppapi_bad_native_files, - ) + node = env.PPAPIBrowserTester( + 'ppapi_bad_native_test.out', + url='ppapi_bad_native.html', + nmfs=[nmf], + files=ppapi_bad_native_files, + ) +else: + ppapi_bad_native_files = [ + env.File('${TEST_DIR}/ppapi_bad_native_glibc.html'), + nacltest_js] + replicated_files = env.Replicate('${STAGING_DIR}', ppapi_bad_native_files) + env.Alias('all_programs', replicated_files) + ppapi_bad_native_files.append(partly_invalid) + + node = env.PPAPIBrowserTester( + 'ppapi_bad_native_test.out', + url='ppapi_bad_native_glibc.html', + nmfs=[nmf], + files=ppapi_bad_native_files, + nacl_exe_stderr={ + 'file': '${TARGET_ROOT}/test_results/ppapi_bad_native_test.log', + 'golden': '${TEST_DIR}/ppapi_bad_native_glibc.stderr'} + ) env.AddNodeToTestSuite(node, ['chrome_browser_tests'], - 'run_ppapi_bad_native_test', - is_broken=env.PPAPIBrowserTesterIsBroken() or - env.Bit('nacl_glibc') or - env.Bit('bitcode')) + 'run_ppapi_bad_native_test', + is_broken=env.PPAPIBrowserTesterIsBroken() or + env.Bit('bitcode')) + + diff --git a/ppapi/native_client/tests/ppapi_browser/bad/ppapi_bad_native_glibc.html b/ppapi/native_client/tests/ppapi_browser/bad/ppapi_bad_native_glibc.html new file mode 100644 index 0000000..ef03798 --- /dev/null +++ b/ppapi/native_client/tests/ppapi_browser/bad/ppapi_bad_native_glibc.html @@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> + <!-- Copyright 2011 Google Inc. All rights reserved. --> + <head> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache" /> + <META HTTP-EQUIV="Expires" CONTENT="-1" /> + <script type="text/javascript" src="nacltest.js"> </script> + <title> PPAPI bad manifest/nexe URLs, glibc. </title> + </head> + <body id="body"> + <embed id="partly_invalid" + class="naclModule" + width=100 height=20 + src="partly_invalid.nmf" + style="background-color:gray" + type="application/x-nacl" /> + + <script type="text/javascript"> + //<![CDATA[ + var tester = new Tester($('body')); + tester.loadErrorsAreOK(); + // This is a dummy test so that we can check output of runnable-ld.so + // using golden file. + tester.addAsyncTest('load_finished', function(status) { + status.expectEvent($('partly_invalid'), 'load', function(event) { + status.fail(); + }); + status.expectEvent($('partly_invalid'), 'loadend', function(event) { + status.pass(); + }); + }); + tester.run(); + //]]> + </script> + </body> +</html> diff --git a/ppapi/native_client/tests/ppapi_browser/bad/ppapi_bad_native_glibc.stderr b/ppapi/native_client/tests/ppapi_browser/bad/ppapi_bad_native_glibc.stderr new file mode 100644 index 0000000..27378c5 --- /dev/null +++ b/ppapi/native_client/tests/ppapi_browser/bad/ppapi_bad_native_glibc.stderr @@ -0,0 +1 @@ +/lib/main.nexe: error while loading shared libraries: /lib/main.nexe: failed to load code from shared object: Invalid argument
\ No newline at end of file |