test_bug391002.xhtml (1273B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> 3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> 4 <!-- 5 https://bugzilla.mozilla.org/show_bug.cgi?id=391002 6 --> 7 <window title="Mozilla Bug 391002" 8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> 10 11 <!-- test results are displayed in the html:body --> 12 <body xmlns="http://www.w3.org/1999/xhtml"> 13 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=391002" 14 target="_blank">Mozilla Bug 391002</a> 15 </body> 16 17 <button id="btn1" command="cmd1"/> 18 19 <button id="btn2"> 20 <observes id="observes" element="cmd1" attribute="label"/> 21 </button> 22 23 <commandset> 24 <command id="cmd1" label="cmd1"/> 25 <command id="cmd2" label="cmd2"/> 26 </commandset> 27 28 <!-- test code goes here --> 29 <script type="application/javascript"><![CDATA[ 30 31 /** Test for Bug 391002 */ 32 33 $("btn1").setAttribute("command", "cmd2"); 34 is($("btn1").getAttribute("label"), $("cmd2").getAttribute("label")) 35 36 $("observes").setAttribute("element", "cmd2"); 37 is($("btn2").getAttribute("label"), $("cmd2").getAttribute("label")) 38 39 ]]></script> 40 </window>