chromium/chrome/test/data/nacl/irt_exception/irt_exception_test.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <!--
  Copyright 2014 The Chromium Authors
  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>Nexe Crash Test</title>
  </head>
  <body>
    <h1>Nexe Crash Test</h1>
    <script type="text/javascript">
      //<![CDATA[
      function createModule(id) {
        return createNaClEmbed({
          id: id,
          src: id + '.nmf',
          width: 1,
          height: 1,
          type: 'application/x-nacl'
        });
      }
      var e = document.body;
      e.appendChild(createModule('irt_exception_test'));
      var tester = new Tester();

      function AddTest(plugin, testName, expectedMessage) {
        tester.addAsyncTest(testName, function(test) {
          test.expectEvent(plugin, 'message',
                           function(e) {
            if (e.data == expectedMessage) {
              test.pass();
            } else {
              test.fail();
            }
          });
          test.expectEvent(plugin, 'crash', function() { test.fail(); })
          plugin.postMessage(testName);
        });
        tester.waitFor(plugin);
      }

      AddTest($('irt_exception_test'),
              'CrashViaSignalHandler', 'CrashViaSignalHandler:PASSED');

      tester.run();
      //]]>
    </script>
  </body>
</html>