Chromium Code Reviews| 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 64% |
| 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..e75756c2c33e19641ca9f30ae361a577cb830ed1 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,40 +10,31 @@ |
| <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' : |
| +var args = getTestArguments({'cpu_count' : |
| 'THIS TEST CANNOT RUN STANDALONE -- run using scons instead'}); |
|
jvoung (off chromium)
2013/04/17 17:07:18
"run using scons" -> "run using browser_test" ?
bsy
2013/04/17 20:55:21
Done.
|
| -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; |
| - } |
| - } |
| -} |
| -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(message_event) { |
| + this.removeEventListener('message', arguments.callee, false); |
|
jvoung (off chromium)
2013/04/17 17:07:18
hmm wonder where "arguments" comes from?
bsy
2013/04/17 20:55:21
cut-n-pasted code from other tests. it appears to
|
| + 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(); |
| } |
| @@ -55,7 +46,7 @@ $('body').addEventListener('error', errorListener, true); |
| <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" |