| Index: chrome/test/data/nacl/sysconf_nprocessors_onln/sysconf_nprocessors_onln_test.html
|
| diff --git a/ppapi/native_client/tests/nacl_browser/fault_injection/fault_pm_nameservice_test.html b/chrome/test/data/nacl/sysconf_nprocessors_onln/sysconf_nprocessors_onln_test.html
|
| similarity index 57%
|
| copy from ppapi/native_client/tests/nacl_browser/fault_injection/fault_pm_nameservice_test.html
|
| copy to chrome/test/data/nacl/sysconf_nprocessors_onln/sysconf_nprocessors_onln_test.html
|
| index 2a9b1e3f9ea9390ee873398667619701f858ab24..335420c4f97ed384750978de16950f006cb312d4 100644
|
| --- a/ppapi/native_client/tests/nacl_browser/fault_injection/fault_pm_nameservice_test.html
|
| +++ b/chrome/test/data/nacl/sysconf_nprocessors_onln/sysconf_nprocessors_onln_test.html
|
| @@ -10,52 +10,41 @@
|
| <meta http-equiv="Pragma" content="no-cache" />
|
| <meta http-equiv="Expires" content="-1" />
|
| <script type="text/javascript" src="nacltest.js"></script>
|
| - <title>Native Client Fault-Injection Test</title>
|
| + <title>Native Client Sysconf _SC_NPROCESSORS_ONLN Test</title>
|
| </head>
|
|
|
| <body id="body">
|
| - <h1>Native Client Fault-Injection Test</h1>
|
| + <h1>Native Client _SC_NPROCESSORS_ONLN Test</h1>
|
| <script type="text/javascript">
|
| //<![CDATA[
|
| var tester = new Tester($('body'));
|
| var gotExpected = false;
|
| -var args = getTestArguments({'expected_error' :
|
| - 'THIS TEST CANNOT RUN STANDALONE -- run using scons instead'});
|
| -var errorListener = function(e) {
|
| - var target_element = e.target;
|
| - if (target_element.id != 'naclModule') {
|
| - alert('not nacl module');
|
| - return;
|
| - }
|
| - if (e.type == 'error') {
|
| - if ($('naclModule').lastError == args.expected_error) {
|
| - gotExpected = true;
|
| - }
|
| - }
|
| -}
|
| +var args = getTestArguments({'cpu_count' :
|
| + 'THIS TEST CANNOT RUN STANDALONE -- run using browser_test instead'});
|
|
|
| -function setupTests(tester) {
|
| - tester.addAsyncTest('dummy', function(status) {
|
| - status.assert(gotExpected);
|
| - status.pass();
|
| +function setupTests(tester, plugin) {
|
| + tester.addAsyncTest('TestSysconfNprocessors', function(status) {
|
| + plugin.addEventListener('message', function handler(message_event) {
|
| + this.removeEventListener('message', handler, false);
|
| + status.assertEqual(message_event.data, args.cpu_count);
|
| + status.pass();
|
| + }, false);
|
| + plugin.postMessage('nprocessors');
|
| });
|
| }
|
|
|
| function runTests() {
|
| - tester.loadErrorsAreOK();
|
| - setupTests(tester);
|
| + setupTests(tester, $('naclModule'));
|
| tester.waitFor($('naclModule'));
|
| tester.run();
|
| }
|
| -
|
| -$('body').addEventListener('error', errorListener, true);
|
| //]]>
|
| </script>
|
| <div>
|
| <embed id="naclModule"
|
| name="naclModule"
|
| width=400 height=400
|
| - src="fault_pm_nameservice_test.nmf"
|
| + src="sysconf_nprocessors_onln_test.nmf"
|
| basic_tests="2"
|
| stress_tests="0"
|
| style="background-color:gray"
|
|
|