|
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="Accessible XUL tabbrowser 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" /> |
|
16 <script type="application/javascript" |
|
17 src="../role.js" /> |
|
18 <script type="application/javascript" |
|
19 src="../relations.js" /> |
|
20 <script type="application/javascript" |
|
21 src="../events.js" /> |
|
22 <script type="application/javascript" |
|
23 src="../browser.js"></script> |
|
24 |
|
25 <script type="application/javascript"> |
|
26 <![CDATA[ |
|
27 //////////////////////////////////////////////////////////////////////////// |
|
28 // Invoker |
|
29 function testTabRelations() |
|
30 { |
|
31 this.eventSeq = [ |
|
32 new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 0), |
|
33 new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1) |
|
34 ]; |
|
35 |
|
36 this.invoke = function testTabRelations_invoke() |
|
37 { |
|
38 var docURIs = ["about:", "about:mozilla"]; |
|
39 tabBrowser().loadTabs(docURIs, false, true); |
|
40 } |
|
41 |
|
42 this.finalCheck = function testTabRelations_finalCheck(aEvent) |
|
43 { |
|
44 //////////////////////////////////////////////////////////////////////// |
|
45 // 'labelled by'/'label for' relations for xul:tab and xul:tabpanel |
|
46 |
|
47 var tabs = tabBrowser().tabContainer.childNodes; |
|
48 var panels = tabBrowser().mTabBox.tabpanels.childNodes; |
|
49 |
|
50 testRelation(panels[0], RELATION_LABELLED_BY, tabs[0]); |
|
51 testRelation(tabs[0], RELATION_LABEL_FOR, panels[0]); |
|
52 testRelation(panels[1], RELATION_LABELLED_BY, tabs[1]); |
|
53 testRelation(tabs[1], RELATION_LABEL_FOR, panels[1]); |
|
54 } |
|
55 |
|
56 this.getID = function testTabRelations_getID() |
|
57 { |
|
58 return "relations of tabs"; |
|
59 } |
|
60 } |
|
61 |
|
62 //////////////////////////////////////////////////////////////////////////// |
|
63 // Test |
|
64 |
|
65 //gA11yEventDumpToConsole = true; // debug stuff |
|
66 |
|
67 var gQueue = null; |
|
68 function doTest() |
|
69 { |
|
70 // Load documents into tabs and wait for DocLoadComplete events caused by |
|
71 // these documents load before we start the test. |
|
72 |
|
73 gQueue = new eventQueue(); |
|
74 |
|
75 gQueue.push(new testTabRelations()); |
|
76 gQueue.onFinish = function() { closeBrowserWindow(); } |
|
77 gQueue.invoke(); // Will call SimpleTest.finish(); |
|
78 } |
|
79 |
|
80 SimpleTest.waitForExplicitFinish(); |
|
81 openBrowserWindow(doTest); |
|
82 ]]> |
|
83 </script> |
|
84 |
|
85 <vbox flex="1" style="overflow: auto;"> |
|
86 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
87 <a target="_blank" |
|
88 href="https://bugzilla.mozilla.org/show_bug.cgi?id=552944" |
|
89 title="No relationship between tabs and associated property page in new tabbrowser construct"> |
|
90 Mozilla Bug 552944 |
|
91 </a><br/> |
|
92 <p id="display"></p> |
|
93 <div id="content" style="display: none"> |
|
94 </div> |
|
95 <pre id="test"> |
|
96 </pre> |
|
97 </body> |
|
98 |
|
99 <vbox id="eventdump"></vbox> |
|
100 </vbox> |
|
101 |
|
102 </window> |
|
103 |