|
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 <!-- |
|
6 html element - simple syntax |
|
7 --> |
|
8 |
|
9 <window title="XUL Template Tests" width="500" height="600" |
|
10 onload="test_template();" |
|
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
12 <script type="application/javascript" |
|
13 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
14 |
|
15 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> |
|
16 |
|
17 <data id="output" xmlns:html="http://www.w3.org/1999/xhtml"> |
|
18 <html:p step="3" id="http://www.some-fictitious-zoo.com/birds/wren" title="Wren"/> |
|
19 <html:p id="http://www.some-fictitious-zoo.com/birds/emu" title="Emu"/> |
|
20 <html:p step="-4" id="http://www.some-fictitious-zoo.com/birds/barnowl" title="Barn Owl"/> |
|
21 <html:p id="http://www.some-fictitious-zoo.com/birds/raven" title="Raven"/> |
|
22 <html:p step="2" id="http://www.some-fictitious-zoo.com/birds/archaeopteryx" title="Archaeopteryx"/> |
|
23 <html:p step="1" id="http://www.some-fictitious-zoo.com/birds/emperorpenguin" title="Emperor Penguin"/> |
|
24 </data> |
|
25 |
|
26 <script src="templates_shared.js"/> |
|
27 |
|
28 <script> |
|
29 <![CDATA[ |
|
30 SimpleTest.waitForExplicitFinish(); |
|
31 |
|
32 var testid ="html element - simple syntax"; |
|
33 var queryType = "rdf"; |
|
34 var isTreeBuilder = false; |
|
35 var needsOpen = false; |
|
36 var notWorkingYet = false; |
|
37 var notWorkingYetDynamic = false; |
|
38 var expectedOutput = document.getElementById("output"); |
|
39 |
|
40 var changes = [ |
|
41 // step 1 |
|
42 function(targetds, root) { |
|
43 var newnode = RDF.GetResource(ZOO_NS + 'birds/emperorpenguin'); |
|
44 targetds.Assert(newnode, RDF.GetResource(ZOO_NS + 'rdf#name'), |
|
45 RDF.GetLiteral('Emperor Penguin'), true); |
|
46 var container = ContainerUtils.MakeSeq(targetds, |
|
47 RDF.GetResource(ZOO_NS + 'birds')); |
|
48 container.AppendElement(newnode); |
|
49 }, |
|
50 // step 2 |
|
51 function(targetds, root) { |
|
52 var newnode = RDF.GetResource(ZOO_NS + 'birds/archaeopteryx'); |
|
53 targetds.Assert(newnode, RDF.GetResource(ZOO_NS + 'rdf#name'), |
|
54 RDF.GetLiteral('Archaeopteryx'), true); |
|
55 var container = ContainerUtils.MakeSeq(targetds, |
|
56 RDF.GetResource(ZOO_NS + 'birds')); |
|
57 container.InsertElementAt(newnode, '4', true); |
|
58 }, |
|
59 // step 3 |
|
60 function(targetds, root) { |
|
61 var newnode = RDF.GetResource(ZOO_NS + 'birds/wren'); |
|
62 targetds.Assert(newnode, RDF.GetResource(ZOO_NS + 'rdf#name'), |
|
63 RDF.GetLiteral('Wren'), true); |
|
64 var container = ContainerUtils.MakeSeq(targetds, |
|
65 RDF.GetResource(ZOO_NS + 'birds')); |
|
66 container.InsertElementAt(newnode, '1', true); |
|
67 }, |
|
68 // step 4 |
|
69 function(targetds, root) { |
|
70 var container = ContainerUtils.MakeSeq(targetds, |
|
71 RDF.GetResource(ZOO_NS + 'birds')); |
|
72 var removednode = container.RemoveElementAt('3', true); |
|
73 targetds.Unassert(removednode, RDF.GetResource(ZOO_NS + 'rdf#name'), |
|
74 RDF.GetLiteral('Barn Owl'), true); |
|
75 } |
|
76 ]; |
|
77 ]]> |
|
78 </script> |
|
79 |
|
80 <div xmlns="http://www.w3.org/1999/xhtml" id="root" datasources="rdf:null" ref="http://www.some-fictitious-zoo.com/birds"><template xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><p xmlns="http://www.w3.org/1999/xhtml" uri="rdf:*" title="rdf:http://www.some-fictitious-zoo.com/rdf#name"/></template></div> |
|
81 </window> |