-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtestcase.js
More file actions
77 lines (70 loc) · 1.95 KB
/
testcase.js
File metadata and controls
77 lines (70 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*Initialization Code*/
// Testcase for Convert E4X button
// https://github.com/Infocatcher/Custom_Buttons/tree/master/Convert_E4X
// Note: this isn't a real code... just looks like
var x = "E4X";
var y = "y";
var xulNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
XML.prettyPrinting = false;
var xml = <menupopup xmlns={xulNS}>
<menuitem label="1" />
<menu label="q\w">
<menupopup>
<menuitem label={x} />
<menuitem label={"Some " + x + " here"} />
<menuitem label="{" />
<menuitem label="}" />
<menuitem label="{x}" />
<menuitem label="Some {data} here" />
</menupopup>
</menu>
</menupopup>;
this.appendChild(cbu.makeXML(xml));
var xml = <menupopup xmlns={xulNS}>
<menuitem label="1" />
<menu label="Menu 1">
<menupopup>
<menuitem label={x} />
<menu label="Menu 2">
<menupopup>
<menu label={"x" + x}>
<menupopup>
<menuitem label="" />
<menuitem label="" foo="{" bar="}" />
</menupopup>
</menu>
<menuitem label={y} />
<menuitem label={x + y} />
</menupopup>
</menu>
</menupopup>
</menu>
</menupopup>;
this.appendChild(cbu.makeXML(xml));
var xml = <menupopup xmlns={xulNS}>
<menuitem label="1" />
<menuitem label={x} />
</menupopup>;
this.appendChild(cbu.makeXML(xml));
var xml = <menupopup xmlns={xulNS} />;
this.appendChild(cbu.makeXML(xml));
var xml = <menupopup xmlns={xulNS}></menupopup>;
this.appendChild(cbu.makeXML(xml));
var box = "hbox";
var ipi = XML.ignoreProcessingInstructions;
XML.ignoreProcessingInstructions = false;
var dialog = <>
<?xml-stylesheet href="chrome://global/skin/"?>
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Test">
<{box}>
<button label="1" />
<button label="2" />
</{box}>
</dialog>
</>.toXMLString();
XML.ignoreProcessingInstructions = ipi;
window.openDialog(
"data:application/vnd.mozilla.xul+xml," + encodeURIComponent(dialog),
"_blank",
"chrome,all,resizable,centerscreen"
);