accessible/tests/mochitest/events/test_namechange.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/events/test_namechange.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,92 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     1.6 +
     1.7 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
     1.8 +                 type="text/css"?>
     1.9 +
    1.10 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    1.11 +
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
    1.14 +  <script type="application/javascript"
    1.15 +          src="chrome://mochikit/content/chrome-harness.js"/>
    1.16 +
    1.17 +  <script type="application/javascript"
    1.18 +          src="../common.js" />
    1.19 +  <script type="application/javascript"
    1.20 +          src="../events.js" />
    1.21 +
    1.22 +  <script type="application/javascript">
    1.23 +  <![CDATA[
    1.24 +
    1.25 +    /**
    1.26 +     * Check name changed a11y event.
    1.27 +     */
    1.28 +    function nameChangeChecker(aMsg, aID)
    1.29 +    {
    1.30 +      this.type = EVENT_NAME_CHANGE;
    1.31 +
    1.32 +      function targetGetter()
    1.33 +      {
    1.34 +        return getAccessible(aID);
    1.35 +      }
    1.36 +      Object.defineProperty(this, "target", { get: targetGetter });
    1.37 +
    1.38 +      this.getID = function getID()
    1.39 +      {
    1.40 +        return aMsg + " name changed";
    1.41 +      }
    1.42 +    }
    1.43 +
    1.44 +    function changeRichListItemChild()
    1.45 +    {
    1.46 +      this.invoke = function changeRichListItemChild_invoke()
    1.47 +      {
    1.48 +        getNode('childcontent').setAttribute('value', 'Changed.');
    1.49 +      }
    1.50 +
    1.51 +      this.eventSeq =
    1.52 +      [
    1.53 +        new nameChangeChecker("changeRichListItemChild: ", "listitem")
    1.54 +      ];
    1.55 +
    1.56 +      this.getID = function changeRichListItemChild_getID()
    1.57 +      {
    1.58 +        return "changeRichListItemChild";
    1.59 +      }
    1.60 +    }
    1.61 +
    1.62 +    function doTest()
    1.63 +    {
    1.64 +      var queue = new eventQueue();
    1.65 +      queue.push(new changeRichListItemChild());
    1.66 +      queue.invoke();
    1.67 +    }
    1.68 +
    1.69 +    SimpleTest.waitForExplicitFinish();
    1.70 +    addA11yLoadEvent(doTest);
    1.71 +  ]]>
    1.72 +  </script>
    1.73 +
    1.74 +  <vbox flex="1" style="overflow: auto;">
    1.75 +    <body xmlns="http://www.w3.org/1999/xhtml">
    1.76 +      <a target="_blank"
    1.77 +        href="https://bugzilla.mozilla.org/show_bug.cgi?id=986054"
    1.78 +        title="Propagate name change events">
    1.79 +       Mozilla Bug 986054
    1.80 +      </a>
    1.81 +
    1.82 +      <p id="display"></p>
    1.83 +      <div id="content" style="display: none">
    1.84 +      </div>
    1.85 +      <pre id="test">
    1.86 +      </pre>
    1.87 +    </body>
    1.88 +
    1.89 +    <richlistbox>
    1.90 +      <richlistitem id="listitem">
    1.91 +        <description id="childcontent" value="This will be changed."/>
    1.92 +      </richlistitem>
    1.93 +    </richlistbox>
    1.94 +  </vbox>
    1.95 +</window>

mercurial