|
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 <window title="Toolbar" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
6 onload="startTest();"> |
|
7 |
|
8 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
9 |
|
10 <toolbox> |
|
11 <toolbarpalette id="palette"/> |
|
12 |
|
13 <toolbar id="tb1" currentset="p1"/> |
|
14 </toolbox> |
|
15 |
|
16 <!-- test resuls are displayed in the html:body --> |
|
17 <body xmlns="http://www.w3.org/1999/xhtml" |
|
18 style="height: 300px; overflow: auto;"/> |
|
19 |
|
20 <!-- test code goes here --> |
|
21 <script type="text/javascript"><![CDATA[ |
|
22 var toolbar = $("tb1"); |
|
23 |
|
24 ok(toolbar, "got the toolbar, triggering the xbl constructor"); |
|
25 |
|
26 var palette = $("palette"); |
|
27 ok(palette, "palette is still in the document"); |
|
28 |
|
29 var button = document.createElement("p1"); |
|
30 button.id = button.label = "p1"; |
|
31 palette.appendChild(button); |
|
32 |
|
33 SimpleTest.waitForExplicitFinish(); |
|
34 function startTest() { |
|
35 is(button.parentNode, toolbar, "button has been added to the toolbar"); |
|
36 SimpleTest.finish(); |
|
37 } |
|
38 ]]></script> |
|
39 </window> |