DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=368835
-->
  <head>
    <title>Test for Bug 368835</title>

    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />

    <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
    <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  </head>

  <body>
    <a target="_blank"
       href="https://bugzilla.mozilla.org/show_bug.cgi?id=368835">
      Mozilla Bug 368835
    </a>
    <p id="display"></p>
    <div id="content" style="display: none">
    </div>
    <pre id="test">
    <script class="testbody" type="text/javascript">
      function dataContainerEventHandler(aEvent)
      {
        var value = "";
        var isPassed = true;
        try {
          value = aEvent.getData("data1");
          isPassed = true;
        } catch (e) {
          isPassed = false;
        }

        ok(isPassed, "getData shouldn't fail.");
        ok(value == "data1", "Wrong value of data.");

        try {
          aEvent.setData("data3", "data3");
          isPassed = false;
        } catch (e) {
          isPassed = true;
        }

        ok(isPassed, "setData should fail during event dispatching.");
      }

      function doTest()
      {
        var isPassed;
        var event = null;

        try {
          event = document.createEvent("datacontainerevents");
          isPassed = true;
        } catch (e) {
          isPassed = false;
        }

        ok(isPassed, "Document should know about 'datacontainerevents' event class.");
        ok(("setData" in event), "nsIDOMDataContainerEvent isn't available.");

        event.initEvent("dataContainerEvent", true, true);

        try {
          event.setData("data1", "data1");
          isPassed = true;
        } catch (e) {
          isPassed = false;
        }

        ok(isPassed, "setData shouldn't fail when event is initialized.");

        document.body.addEventListener("dataContainerEvent",
                                       dataContainerEventHandler, true);
        document.body.dispatchEvent(event);
      }

      SimpleTest.waitForExplicitFinish();
      addLoadEvent(doTest);
      addLoadEvent(SimpleTest.finish);
    </script>
    </pre>
  </body>
</html>