diff options
author | ncbray@chromium.org <ncbray@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-16 18:09:16 +0000 |
---|---|---|
committer | ncbray@chromium.org <ncbray@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-16 18:09:16 +0000 |
commit | 36ac5fbe3d4784fbed7d1040f1334ceb54497fe4 (patch) | |
tree | e8665fe002cb13f7e82280b0556646865dd5acff /ppapi | |
parent | 58f33c3ffd0dfebf720bdc7581ccc1ef77845189 (diff) | |
download | chromium_src-36ac5fbe3d4784fbed7d1040f1334ceb54497fe4.zip chromium_src-36ac5fbe3d4784fbed7d1040f1334ceb54497fe4.tar.gz chromium_src-36ac5fbe3d4784fbed7d1040f1334ceb54497fe4.tar.bz2 |
Remove more tests from the NaCl SCons build.
* pnacl_test_example was a smoke test that broke in revision r161425.
* browser_startup_time was a performance test that needs to be redone to work on the Chrome bots.
* stress_many_nexes was a manual test.
BUG= http://code.google.com/p/chromium/issues/detail?id=154400
Review URL: https://chromiumcodereview.appspot.com/11145002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162173 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
12 files changed, 14 insertions, 483 deletions
diff --git a/ppapi/native_client/chrome_main.scons b/ppapi/native_client/chrome_main.scons index 8d72327..e18e5d1 100644 --- a/ppapi/native_client/chrome_main.scons +++ b/ppapi/native_client/chrome_main.scons @@ -40,7 +40,6 @@ def ExtendFileList(existing, additional): ppapi_scons_files['nonvariant_test_scons_files'] = ExtendFileList( ppapi_scons_files.get('nonvariant_test_scons_files', []), [ 'tests/nacl_browser/browser_dynamic_library/nacl.scons', - 'tests/nacl_browser/browser_startup_time/nacl.scons', 'tests/nacl_browser/inbrowser_test_runner/nacl.scons', 'tests/nacl_browser/manifest_file/nacl.scons', 'tests/nacl_browser/nameservice/nacl.scons', diff --git a/ppapi/native_client/ppapi_scons_files.py b/ppapi/native_client/ppapi_scons_files.py index 42511d79..aa79ddd 100644 --- a/ppapi/native_client/ppapi_scons_files.py +++ b/ppapi/native_client/ppapi_scons_files.py @@ -36,7 +36,6 @@ nonvariant_test_scons_files = [ 'tests/ppapi_browser/ppp_input_event/nacl.scons', 'tests/ppapi_browser/ppp_instance/nacl.scons', 'tests/ppapi_browser/progress_events/nacl.scons', - 'tests/ppapi_browser/stress_many_nexes/nacl.scons', 'tests/ppapi_messaging/nacl.scons', 'tests/ppapi_test_lib/nacl.scons', ] diff --git a/ppapi/native_client/tests/nacl_browser/browser_startup_time/browser_startup_time.html b/ppapi/native_client/tests/nacl_browser/browser_startup_time/browser_startup_time.html deleted file mode 100644 index bec7cfe..0000000 --- a/ppapi/native_client/tests/nacl_browser/browser_startup_time/browser_startup_time.html +++ /dev/null @@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html> - <!-- Copyright (c) 2011 The Chromium Authors. All rights reserved. --> - <!-- Measures startup time for ppapi_test_example (a dependency). --> - <head> - <title> Startup Timing Test </title> - <script type="text/javascript" src="nacltest.js"></script> - <script type="text/javascript" src="browser_startup_time.js"></script> - </head> - <body> - <h1>Startup Timing Test</h1> - <embed type="application/x-nacl" id="nacl_server" - name="nacl_module" width="0" height="0" - src="browser_startup_time.nmf" /> - <script type="text/javascript"> - //<![CDATA[ - var loadingTester = new LoadingTester($('nacl_server')); - loadingTester.setupLoad(); - //]]> - </script> - </body> -</html> diff --git a/ppapi/native_client/tests/nacl_browser/browser_startup_time/browser_startup_time.js b/ppapi/native_client/tests/nacl_browser/browser_startup_time/browser_startup_time.js deleted file mode 100644 index 4aee3c4..0000000 --- a/ppapi/native_client/tests/nacl_browser/browser_startup_time/browser_startup_time.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2011 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. - -// Times how long the nexe took to load, then smoke tests it. - -function LoadingTester(plugin) { - // Workaround how JS binds 'this' - var this_ = this; - - this.rpc_ = new RPCWrapper(); - - this.setupLoad = function() { - var loadBegin = (new Date).getTime(); - this_.rpc_.startup(); - var waiter = new NaClWaiter(); - - waiter.waitFor(plugin); - waiter.run( - function(loaded, waiting) { - var loadEnd = (new Date).getTime(); - logLoadStatus(this_.rpc_, true, loaded, waiting); - // Log the total in-browser load time (for first load). - this_.rpc_.logTimeData('Total', - (loadEnd - loadBegin)); - this_.doSmokeTests_(plugin); - }, - function() { - this_.rpc_.ping(); - } - ); - } - - this.doSmokeTests_ = function(plugin) { - var tester = new Tester(); - tester.addAsyncTest('TestHello', function(status) { - plugin.addEventListener('message', function(message_event) { - this.removeEventListener('message', arguments.callee, false); - status.assertEqual(message_event.data, 'hello from NaCl'); - status.pass(); - }, false); - plugin.postMessage('hello'); - }); - tester.run(); - } -} diff --git a/ppapi/native_client/tests/nacl_browser/browser_startup_time/hello_world.cc b/ppapi/native_client/tests/nacl_browser/browser_startup_time/hello_world.cc deleted file mode 100644 index d7b408e..0000000 --- a/ppapi/native_client/tests/nacl_browser/browser_startup_time/hello_world.cc +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2011 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. - -// A basic PPAPI-based hello world. Used to measure the size and startup -// time of a really small program. - -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/var.h" - -namespace { -// The expected string sent by the browser. -const char* const kHelloString = "hello"; - -// The string sent back to the browser upon receipt of a message -// containing "hello". -const char* const kReplyString = "hello from NaCl"; -} // namespace - -namespace hello_world { -class HelloWorldInstance : public pp::Instance { - public: - explicit HelloWorldInstance(PP_Instance instance) : pp::Instance(instance) {} - virtual ~HelloWorldInstance() {} - virtual void HandleMessage(const pp::Var& var_message); -}; - -void HelloWorldInstance::HandleMessage(const pp::Var& var_message) { - if (!var_message.is_string()) { - return; - } - std::string message = var_message.AsString(); - pp::Var var_reply; - if (message == kHelloString) - var_reply = pp::Var(kReplyString); - PostMessage(var_reply); -} - -class HelloWorldModule : public pp::Module { - public: - HelloWorldModule() : pp::Module() {} - virtual ~HelloWorldModule() {} - - virtual pp::Instance* CreateInstance(PP_Instance instance) { - return new HelloWorldInstance(instance); - } -}; -} // namespace hello_world - -namespace pp { -/// Factory function called by the browser when the module is first loaded. -/// The browser keeps a singleton of this module. It calls the -/// CreateInstance() method on the object you return to make instances. There -/// is one instance per <embed> tag on the page. This is the main binding -/// point for your NaCl module with the browser. -/// @return new HelloWorldModule. -/// @note The browser is responsible for deleting returned @a Module. -Module* CreateModule() { - return new hello_world::HelloWorldModule(); -} -} // namespace pp diff --git a/ppapi/native_client/tests/nacl_browser/browser_startup_time/nacl.scons b/ppapi/native_client/tests/nacl_browser/browser_startup_time/nacl.scons deleted file mode 100644 index 10c0c076..0000000 --- a/ppapi/native_client/tests/nacl_browser/browser_startup_time/nacl.scons +++ /dev/null @@ -1,73 +0,0 @@ -# -*- python -*- -# Copyright (c) 2012 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. - -# Test startup time for loading a basic PPAPI nexe in the browser. - -Import('env') - -nexe_name = env.ProgramNameForNmf('browser_startup_time') -stripped_nexe = env.ProgramNameForNmf('browser_startup_time_stripped') - -browser_startup_nexe = env.ComponentProgram( - nexe_name, - ['hello_world.cc'], - EXTRA_LIBS=['ppapi_cpp']) - -env.Publish(nexe_name, 'run', - ['browser_startup_time.html', - 'browser_startup_time.js']) - -test_name = 'browser_startup_time.out' -output_processor_1 = ['${PYTHON}', - str(env.File( - '${SCONSTRUCT_DIR}/tools/process_perf_output.py')), - test_name, - env.GetPerfEnvDescription()] -output_processor_c = ['${PYTHON}', - str(env.File( - '${SCONSTRUCT_DIR}/tools/process_perf_combined.py'))] - - -node = env.PPAPIBrowserTester( - test_name, - url='browser_startup_time.html', - nmf_names=['browser_startup_time'], - files=env.ExtractPublishedFiles(nexe_name), - # Smooth out the timing data. - num_runs=5, - process_output_single=output_processor_1, - process_output_combined=output_processor_c, - # Assume verbosity level of 1 will give us NaClLogs for sel_ldr times. - log_verbosity=1) - -# TODO(jvoung): use a single test suite when either -# (a) performance_tests are always run, or -# (b) we have decided to just fold this test into chrome_browser_tests. -test_suites = ['chrome_browser_tests', 'performance_tests'] -env.AddNodeToTestSuite(node, - test_suites, - 'run_browser_startup_time_test', - # This test relies on NACLLOG, which must be able to - # open a file. This won't work with the outer sandbox - # which is enabled in some cases. - is_broken=(env.PPAPIBrowserTesterIsBroken() or - True)) - -# Also check the size of this nexe. -node = env.FileSizeTest('browser_startup_size.out', - browser_startup_nexe) -env.AddNodeToTestSuite(node, - test_suites, - 'run_browser_startup_size_test') - -# Check size of stripped nexe. -browser_startup_stripped_nexe = env.StripExecutable( - stripped_nexe, - browser_startup_nexe) -node = env.FileSizeTest('browser_startup_stripped_size.out', - browser_startup_stripped_nexe) -env.AddNodeToTestSuite(node, - test_suites, - 'run_browser_startup_stripped_size_test') diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/nacl.scons b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/nacl.scons index 24b8240..126642b 100644 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/nacl.scons +++ b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/nacl.scons @@ -19,46 +19,6 @@ if not (env.Bit('bitcode') and env.Bit('pnacl_generate_pexe')): if env.Bit('nacl_glibc') and env.Bit('target_x86_64'): Return() -#---------------------------------------------------------------------- -# Test pexe translation. - -# Specify the object file to prevent junk from getting left over -# in source directory. SCons will default to point "-o" to the source -# directory if it is an absolute directory. -test_example_obj = env.ComponentObject( - 'pnacl_test_example_obj', - '${SCONSTRUCT_DIR}/tests/ppapi_test_example/ppapi_test_example.cc') - -pexe_name = env.ProgramNameForNmf('pnacl_test_example') - -test_example_pexe = env.ComponentProgram( - pexe_name, - [test_example_obj], - EXTRA_LIBS=['ppapi', - 'ppapi_test_lib', - 'platform', # for CHECK - 'pthread', - 'gio', - ]) - -# Grab test routines. -borrowed_file = '${STAGING_DIR}/ppapi_test_example.js', - -env.Publish(pexe_name, - 'run', - ['pnacl_test_example.html']) - -node = env.PPAPIBrowserTester( - 'pnacl_test_example.out', - url='pnacl_test_example.html', - nmf_names=['pnacl_test_example'], - files=env.ExtractPublishedFiles(pexe_name) + [borrowed_file]) - -env.AddNodeToTestSuite(node, - ['chrome_browser_tests'], - 'run_pnacl_example_browser_test', - is_broken=env.PPAPIBrowserTesterIsBroken()) - #### Test error handling. # We should add more cases, e.g., try a bad library to crash ld, @@ -66,6 +26,8 @@ env.AddNodeToTestSuite(node, # The current llc tests, don't actually crash LLC, they only # make llc exit w/ an abnormal status. +program_fragment_obj = env.ComponentObject('program_fragment.cc') + pnacl_bad_files = env.Replicate( '${STAGING_DIR}', ['pnacl_bad_doesnotexist.nmf', @@ -76,15 +38,11 @@ pnacl_bad_files = env.Replicate( # This one is the hello world bitcode .ll w/ a missing instruction. 'bad2.pexe', 'pnacl_bad2_pexe.nmf', - # Borrow the bitcode file from the test above and treat it as a - # pexe so that the compile succeeds but linking fails. - 'pnacl_test_example_obj.bc', + program_fragment_obj, 'pnacl_bad_pexe_undefined_syms.nmf', 'pnacl_bad_test.html', ]) -env.Depends(pnacl_bad_files, test_example_obj) - # Borrow bad load test harness. borrowed_file = '${STAGING_DIR}/ppapi_bad.js', diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe_undefined_syms.nmf b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe_undefined_syms.nmf index bfe5ca7..8fe0bed 100644 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe_undefined_syms.nmf +++ b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe_undefined_syms.nmf @@ -3,6 +3,6 @@ "x86-32": {"url": "non_existent.nexe"}, "x86-64": {"url": "non_existent.nexe"}, "arm": {"url": "non_existent.nexe"}, - "portable": {"pnacl-translate": {"url": "pnacl_test_example_obj.bc"} } + "portable": {"pnacl-translate": {"url": "program_fragment.bc"} } } } diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_test_example.html b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_test_example.html deleted file mode 100644 index c57ae03..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_test_example.html +++ /dev/null @@ -1,108 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<!-- - Copyright (c) 2012 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. ---> -<html> -<head> - <META HTTP-EQUIV="Pragma" CONTENT="no-cache" /> - <META HTTP-EQUIV="Expires" CONTENT="-1" /> - <title>PNACL Test Example (PPAPI Test Example Clone)</title> - <script type="text/javascript" src="nacltest.js"></script> - <script type="text/javascript" src="ppapi_test_example.js"></script> - <script type="text/javascript"> - //<![CDATA[ - function pageDidLoad() { - // Set up a ticker so that we know that the UI thread is not blocked. - var quantum = 50; - var startTime = (new Date).getTime(); - var done = false; - var updateUI = function() { - var start_end_div = $('start_end'); - var now = (new Date).getTime(); - start_end_div.innerText = String(now - startTime); - updateCanvas(); - if (!done) { - setTimeout(updateUI, quantum); - } - } - setTimeout(updateUI, quantum); - - var updateProgress = function() { - var progress_div = $('progress_area'); - progress_div.innerText += '.'; - } - - var handleLoadEnd = function() { - done = true; - } - - // For canvas drawing. - var hpos = 0; - var color = 0; - // The colors of the rainbow. - var palette = - new Array("#ff0000", "#ff7f00", "#ffff00", "#00ff00", "#0000ff", - "#6600ff", "#8b00ff"); - var updateCanvas = function() { - var canvas = document.getElementById('canvas'); - var hsize = canvas.width; - var boxHeight = canvas.height; - var ctx = canvas.getContext('2d'); - ctx.fillStyle = palette[color]; - if (!ctx) { - return; - } - boxWidth = Math.min(boxHeight, hsize - hpos); - ctx.fillRect(hpos, 0, boxWidth, boxHeight); - hpos += boxWidth; - if (hpos >= hsize) { - hpos = 0; - color++; - if (color >= palette.length) { - color = 0; - } - } - } - - var nexe_div = $('test_nexe'); - nexe_div.addEventListener('loadstart', updateProgress, true); - nexe_div.addEventListener('progress', updateProgress, true); - nexe_div.addEventListener('load', updateProgress, true); - nexe_div.addEventListener('loadend', handleLoadEnd, true); - } -//]]> - </script> -</head> -<body onload="pageDidLoad()"> - - <h1>PNACL Test Example</h1> - - <embed type="application/x-nacl" id="test_nexe" - name="nacl_module" - src="pnacl_test_example.nmf" - width="20" height="20" - style="background-color:gray" /> - - <script type="text/javascript"> - //<![CDATA[ - var tester = new Tester(); - setupTests(tester, $('test_nexe')); - tester.waitFor($('test_nexe')); - tester.run(); - //]]> - </script> - - <p>Page start to loadend (millisecs):</p> - <div id="start_end"> 0.0 </div> - <p> This will animate when the UI thread is not blocked (until loadend):</p> - <canvas id="canvas" width="200" height="10"> - </canvas> - - <p> Download progress:</p> - <div id="progress_area" style="font-size:28pt; color:#FF9900;"> </div> - -</body> -</html> diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/program_fragment.cc b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/program_fragment.cc new file mode 100644 index 0000000..8dafe92 --- /dev/null +++ b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/program_fragment.cc @@ -0,0 +1,10 @@ +// Copyright (c) 2012 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. + +// Never defined. This will end badly when we try to link. +extern void bar(); + +void foo() { + bar(); +} diff --git a/ppapi/native_client/tests/ppapi_browser/stress_many_nexes/nacl.scons b/ppapi/native_client/tests/ppapi_browser/stress_many_nexes/nacl.scons deleted file mode 100644 index 486b8d7..0000000 --- a/ppapi/native_client/tests/ppapi_browser/stress_many_nexes/nacl.scons +++ /dev/null @@ -1,36 +0,0 @@ -# -*- python -*- -# Copyright (c) 2012 The Native Client Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -Import('env') - -stress_files = [ - env.File('stress_many_nexes.html'), - env.File('${SCONSTRUCT_DIR}/tools/browser_tester/browserdata/nacltest.js'), - ] -replicated_files = env.Replicate('${STAGING_DIR}', stress_files) -env.Alias('all_programs', replicated_files) - -# NOTE: Since NMFs are now autogenerated there is no ppapi_ppb_core.nmf -# file that is checked-in and staged anymore. This test will need to -# be converted to have its own nexe and its own nmf if we ever choose -# to enable it (is_broken=True below). -core = env.File('${STAGING_DIR}/ppapi_ppb_core_${TARGET_FULLARCH}${PROGSUFFIX}') -nmf = env.File('${STAGING_DIR}/ppapi_ppb_core.nmf') -stress_files.extend([core, nmf]) - -node = env.PPAPIBrowserTester( - 'stress_many_nexes_test.out', - url='stress_many_nexes.html', - test_args=(('count', 100), ('parallel', 0)), - timeout=200, - files=stress_files) - -env.AddNodeToTestSuite(node, - ['chrome_browser_tests'], - 'run_stress_many_nexes_test', - # Don't run this test automatically. It can cause random - # processes to die on a machine, etc. - is_broken=True) diff --git a/ppapi/native_client/tests/ppapi_browser/stress_many_nexes/stress_many_nexes.html b/ppapi/native_client/tests/ppapi_browser/stress_many_nexes/stress_many_nexes.html deleted file mode 100644 index 79fd082..0000000 --- a/ppapi/native_client/tests/ppapi_browser/stress_many_nexes/stress_many_nexes.html +++ /dev/null @@ -1,87 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html> - <!-- - Copyright (c) 2011 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. - --> - <head> - <META HTTP-EQUIV="Pragma" CONTENT="no-cache" /> - <META HTTP-EQUIV="Expires" CONTENT="-1" /> - <script type="text/javascript" src="nacltest.js"> </script> - <title>Browser Stress Test</title> - <style type="text/css"> - .naclModule { background-color: gray; margin: 2px 2px; } - .naclPassed { background-color: green; margin: 2px 2px; } - .naclFailed { background-color: red; margin: 2px 2px; } - </style> - </head> - <body id="body"> -<script type="text/javascript"> -//<![CDATA[ - -function createEmbed(id) { - return createNaClEmbed({ - id: id, - src: 'ppapi_ppb_core.nmf', - width: 100, - height: 20 - }); -} - - -function checkEmbed(test, embed) { - embed.className = 'naclFailed'; - test.assertEqual(embed.readyState, 4); - test.assertEqual(embed.lastError, ''); - embed.className = 'naclPassed'; - test.pass(); -} - - -function addParallelTest(tester, i) { - var name = 'nacl_' + i; - var embed = createEmbed(name); - tester.waitFor(embed); - tester.addAsyncTest(name, function(test) { - checkEmbed(test, embed); - }); - document.body.appendChild(embed); -} - - -function addSerialTest(tester, i) { - var name = 'nacl_' + i; - tester.addAsyncTest(name, function(test){ - var embed = createEmbed(name); - test.expectEvent(embed, 'loadend', function() { - checkEmbed(test, embed); - }); - document.body.appendChild(embed); - }); -} - - -function initTests(tester) { - var args = getTestArguments({'count': '100', 'parallel': '0'}); - for (var i = 0; i < args.count; i++) { - if (parseInt(args.parallel)) { - // Faster, lets the browser determine load order and interleaving. - addParallelTest(tester, i); - } else { - // Slower, forces sequential load order. - addSerialTest(tester, i); - } - } -} - - -var tester = new Tester($('body')); -initTests(tester); -tester.run(); - - //]]> - </script> - </body> -</html> |