Home | History | Annotate | Download | only in fault_injection
      1 <!--
      2   Copyright (c) 2011 The Chromium Authors. All rights reserved.
      3   Use of this source code is governed by a BSD-style license that can
      4   be found in the LICENSE file.
      5 -->
      6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      7   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      8 <html>
      9   <head>
     10     <meta http-equiv="Pragma" content="no-cache" />
     11     <meta http-equiv="Expires" content="-1" />
     12     <script type="text/javascript" src="nacltest.js"></script>
     13     <title>Native Client Fault-Injection Test</title>
     14   </head>
     15 
     16   <body id="body">
     17     <h1>Native Client Fault-Injection Test</h1>
     18     <script type="text/javascript">
     19     //<![CDATA[
     20 var tester = new Tester($('body'));
     21 var gotExpected = false;
     22 var args = getTestArguments({'expected_error' :
     23   'THIS TEST CANNOT RUN STANDALONE -- run using scons instead'});
     24 var errorListener = function(e) {
     25   var target_element = e.target;
     26   if (target_element.id != 'naclModule') {
     27     alert('not nacl module');
     28     return;
     29   }
     30   if (e.type == 'error') {
     31     if ($('naclModule').lastError == args.expected_error) {
     32       gotExpected = true;
     33     }
     34   }
     35 }
     36 
     37 function setupTests(tester) {
     38   tester.addAsyncTest('dummy', function(status) {
     39     status.assert(gotExpected);
     40     status.pass();
     41   });
     42 }
     43 
     44 function runTests() {
     45   tester.loadErrorsAreOK();
     46   setupTests(tester);
     47   tester.waitFor($('naclModule'));
     48   tester.run();
     49 }
     50 
     51 $('body').addEventListener('error', errorListener, true);
     52     //]]>
     53   </script>
     54     <div>
     55     <embed id="naclModule"
     56            name="naclModule"
     57            width=400 height=400
     58            src="fault_pm_nameservice_test.nmf"
     59            basic_tests="2"
     60            stress_tests="0"
     61            style="background-color:gray"
     62            type="application/x-nacl" />
     63     </div>
     64     <script type="text/javascript">
     65     //<![CDATA[
     66 runTests();
     67     //]]>
     68     </script>
     69   </body>
     70 </html>
     71