accessible/tests/mochitest/relations/test_tabbrowser.xul

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial