accessible/tests/mochitest/events/test_namechange.xul

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 <?xml version="1.0"?>
michael@0 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
michael@0 3
michael@0 4 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
michael@0 5 type="text/css"?>
michael@0 6
michael@0 7 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
michael@0 8
michael@0 9 <script type="application/javascript"
michael@0 10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
michael@0 11 <script type="application/javascript"
michael@0 12 src="chrome://mochikit/content/chrome-harness.js"/>
michael@0 13
michael@0 14 <script type="application/javascript"
michael@0 15 src="../common.js" />
michael@0 16 <script type="application/javascript"
michael@0 17 src="../events.js" />
michael@0 18
michael@0 19 <script type="application/javascript">
michael@0 20 <![CDATA[
michael@0 21
michael@0 22 /**
michael@0 23 * Check name changed a11y event.
michael@0 24 */
michael@0 25 function nameChangeChecker(aMsg, aID)
michael@0 26 {
michael@0 27 this.type = EVENT_NAME_CHANGE;
michael@0 28
michael@0 29 function targetGetter()
michael@0 30 {
michael@0 31 return getAccessible(aID);
michael@0 32 }
michael@0 33 Object.defineProperty(this, "target", { get: targetGetter });
michael@0 34
michael@0 35 this.getID = function getID()
michael@0 36 {
michael@0 37 return aMsg + " name changed";
michael@0 38 }
michael@0 39 }
michael@0 40
michael@0 41 function changeRichListItemChild()
michael@0 42 {
michael@0 43 this.invoke = function changeRichListItemChild_invoke()
michael@0 44 {
michael@0 45 getNode('childcontent').setAttribute('value', 'Changed.');
michael@0 46 }
michael@0 47
michael@0 48 this.eventSeq =
michael@0 49 [
michael@0 50 new nameChangeChecker("changeRichListItemChild: ", "listitem")
michael@0 51 ];
michael@0 52
michael@0 53 this.getID = function changeRichListItemChild_getID()
michael@0 54 {
michael@0 55 return "changeRichListItemChild";
michael@0 56 }
michael@0 57 }
michael@0 58
michael@0 59 function doTest()
michael@0 60 {
michael@0 61 var queue = new eventQueue();
michael@0 62 queue.push(new changeRichListItemChild());
michael@0 63 queue.invoke();
michael@0 64 }
michael@0 65
michael@0 66 SimpleTest.waitForExplicitFinish();
michael@0 67 addA11yLoadEvent(doTest);
michael@0 68 ]]>
michael@0 69 </script>
michael@0 70
michael@0 71 <vbox flex="1" style="overflow: auto;">
michael@0 72 <body xmlns="http://www.w3.org/1999/xhtml">
michael@0 73 <a target="_blank"
michael@0 74 href="https://bugzilla.mozilla.org/show_bug.cgi?id=986054"
michael@0 75 title="Propagate name change events">
michael@0 76 Mozilla Bug 986054
michael@0 77 </a>
michael@0 78
michael@0 79 <p id="display"></p>
michael@0 80 <div id="content" style="display: none">
michael@0 81 </div>
michael@0 82 <pre id="test">
michael@0 83 </pre>
michael@0 84 </body>
michael@0 85
michael@0 86 <richlistbox>
michael@0 87 <richlistitem id="listitem">
michael@0 88 <description id="childcontent" value="This will be changed."/>
michael@0 89 </richlistitem>
michael@0 90 </richlistbox>
michael@0 91 </vbox>
michael@0 92 </window>

mercurial