|
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" |
|
4 type="text/css"?> |
|
5 |
|
6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
7 title="Embeds relation tests"> |
|
8 |
|
9 <script type="application/javascript" |
|
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> |
|
11 <script type="application/javascript" |
|
12 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
|
13 |
|
14 <script type="application/javascript" |
|
15 src="../common.js"></script> |
|
16 <script type="application/javascript" |
|
17 src="../role.js"></script> |
|
18 <script type="application/javascript" |
|
19 src="../states.js"></script> |
|
20 <script type="application/javascript" |
|
21 src="../events.js"></script> |
|
22 <script type="application/javascript" |
|
23 src="../relations.js"></script> |
|
24 <script type="application/javascript" |
|
25 src="../browser.js"></script> |
|
26 |
|
27 <script type="application/javascript"> |
|
28 <![CDATA[ |
|
29 //////////////////////////////////////////////////////////////////////////// |
|
30 // Invokers |
|
31 |
|
32 function loadURI(aURI) |
|
33 { |
|
34 this.invoke = function loadURI_invoke() |
|
35 { |
|
36 tabBrowser().loadURI(aURI); |
|
37 } |
|
38 |
|
39 this.eventSeq = [ |
|
40 new invokerChecker(EVENT_REORDER, currentBrowser) |
|
41 ]; |
|
42 |
|
43 this.finalCheck = function loadURI_finalCheck() |
|
44 { |
|
45 testRelation(browserDocument(), RELATION_EMBEDS, |
|
46 getAccessible(currentTabDocument())); |
|
47 } |
|
48 |
|
49 this.getID = function loadURI_getID() |
|
50 { |
|
51 return "load uri " + aURI; |
|
52 } |
|
53 } |
|
54 |
|
55 function browserReorderChecker() |
|
56 { |
|
57 this.type = EVENT_REORDER; |
|
58 |
|
59 this.match = function browserReorderChecker_match(aEvent) |
|
60 { |
|
61 // Reorder event might be duped because of temporary document creation. |
|
62 if (aEvent.accessible == getAccessible(currentBrowser())) { |
|
63 this.cnt++; |
|
64 return this.cnt != 2; |
|
65 } |
|
66 |
|
67 return false; |
|
68 } |
|
69 |
|
70 this.cnt = 0; |
|
71 } |
|
72 |
|
73 function loadOneTab(aURI) |
|
74 { |
|
75 this.invoke = function loadOneTab_invoke() |
|
76 { |
|
77 tabBrowser().loadOneTab(aURI, null, null, null, false); |
|
78 } |
|
79 |
|
80 this.eventSeq = [ |
|
81 new browserReorderChecker() |
|
82 ]; |
|
83 |
|
84 this.finalCheck = function loadURI_finalCheck() |
|
85 { |
|
86 testRelation(browserDocument(), RELATION_EMBEDS, |
|
87 getAccessible(currentTabDocument())); |
|
88 } |
|
89 |
|
90 this.getID = function loadOneTab_getID() |
|
91 { |
|
92 return "load uri '" + aURI + "' in new tab"; |
|
93 } |
|
94 } |
|
95 |
|
96 //////////////////////////////////////////////////////////////////////////// |
|
97 // Testing |
|
98 |
|
99 gA11yEventDumpToConsole = true; // debug |
|
100 |
|
101 var gQueue = null; |
|
102 function doTests() |
|
103 { |
|
104 testRelation(browserDocument(), RELATION_EMBEDS, |
|
105 getAccessible(currentTabDocument())); |
|
106 |
|
107 enableLogging("docload"); |
|
108 gQueue = new eventQueue(); |
|
109 |
|
110 gQueue.push(new loadURI("about:about")); |
|
111 gQueue.push(new loadOneTab("about:mozilla")); |
|
112 |
|
113 gQueue.onFinish = function() |
|
114 { |
|
115 disableLogging(); |
|
116 closeBrowserWindow(); |
|
117 } |
|
118 gQueue.invoke(); |
|
119 } |
|
120 |
|
121 SimpleTest.waitForExplicitFinish(); |
|
122 openBrowserWindow(doTests, "about:"); |
|
123 ]]> |
|
124 </script> |
|
125 |
|
126 <vbox flex="1" style="overflow: auto;"> |
|
127 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
128 <a target="_blank" |
|
129 href="https://bugzilla.mozilla.org/show_bug.cgi?id=707654" |
|
130 title="Embeds relation on root accessible can return not content document"> |
|
131 Mozilla Bug 707654 |
|
132 </a> |
|
133 <p id="display"></p> |
|
134 <div id="content" style="display: none"> |
|
135 </div> |
|
136 <pre id="test"> |
|
137 </pre> |
|
138 </body> |
|
139 </vbox> |
|
140 </window> |