1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/relations/test_tabbrowser.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,103 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" 1.7 + type="text/css"?> 1.8 + 1.9 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 1.10 + title="Accessible XUL tabbrowser relation tests"> 1.11 + 1.12 + <script type="application/javascript" 1.13 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 1.14 + <script type="application/javascript" 1.15 + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 1.16 + 1.17 + <script type="application/javascript" 1.18 + src="../common.js" /> 1.19 + <script type="application/javascript" 1.20 + src="../role.js" /> 1.21 + <script type="application/javascript" 1.22 + src="../relations.js" /> 1.23 + <script type="application/javascript" 1.24 + src="../events.js" /> 1.25 + <script type="application/javascript" 1.26 + src="../browser.js"></script> 1.27 + 1.28 + <script type="application/javascript"> 1.29 + <![CDATA[ 1.30 + //////////////////////////////////////////////////////////////////////////// 1.31 + // Invoker 1.32 + function testTabRelations() 1.33 + { 1.34 + this.eventSeq = [ 1.35 + new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 0), 1.36 + new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1) 1.37 + ]; 1.38 + 1.39 + this.invoke = function testTabRelations_invoke() 1.40 + { 1.41 + var docURIs = ["about:", "about:mozilla"]; 1.42 + tabBrowser().loadTabs(docURIs, false, true); 1.43 + } 1.44 + 1.45 + this.finalCheck = function testTabRelations_finalCheck(aEvent) 1.46 + { 1.47 + //////////////////////////////////////////////////////////////////////// 1.48 + // 'labelled by'/'label for' relations for xul:tab and xul:tabpanel 1.49 + 1.50 + var tabs = tabBrowser().tabContainer.childNodes; 1.51 + var panels = tabBrowser().mTabBox.tabpanels.childNodes; 1.52 + 1.53 + testRelation(panels[0], RELATION_LABELLED_BY, tabs[0]); 1.54 + testRelation(tabs[0], RELATION_LABEL_FOR, panels[0]); 1.55 + testRelation(panels[1], RELATION_LABELLED_BY, tabs[1]); 1.56 + testRelation(tabs[1], RELATION_LABEL_FOR, panels[1]); 1.57 + } 1.58 + 1.59 + this.getID = function testTabRelations_getID() 1.60 + { 1.61 + return "relations of tabs"; 1.62 + } 1.63 + } 1.64 + 1.65 + //////////////////////////////////////////////////////////////////////////// 1.66 + // Test 1.67 + 1.68 + //gA11yEventDumpToConsole = true; // debug stuff 1.69 + 1.70 + var gQueue = null; 1.71 + function doTest() 1.72 + { 1.73 + // Load documents into tabs and wait for DocLoadComplete events caused by 1.74 + // these documents load before we start the test. 1.75 + 1.76 + gQueue = new eventQueue(); 1.77 + 1.78 + gQueue.push(new testTabRelations()); 1.79 + gQueue.onFinish = function() { closeBrowserWindow(); } 1.80 + gQueue.invoke(); // Will call SimpleTest.finish(); 1.81 + } 1.82 + 1.83 + SimpleTest.waitForExplicitFinish(); 1.84 + openBrowserWindow(doTest); 1.85 + ]]> 1.86 + </script> 1.87 + 1.88 + <vbox flex="1" style="overflow: auto;"> 1.89 + <body xmlns="http://www.w3.org/1999/xhtml"> 1.90 + <a target="_blank" 1.91 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=552944" 1.92 + title="No relationship between tabs and associated property page in new tabbrowser construct"> 1.93 + Mozilla Bug 552944 1.94 + </a><br/> 1.95 + <p id="display"></p> 1.96 + <div id="content" style="display: none"> 1.97 + </div> 1.98 + <pre id="test"> 1.99 + </pre> 1.100 + </body> 1.101 + 1.102 + <vbox id="eventdump"></vbox> 1.103 + </vbox> 1.104 + 1.105 +</window> 1.106 +