1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/treeupdate/test_deck.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,109 @@ 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="Tree update on XUL deck panel switching"> 1.11 + 1.12 + <script type="application/javascript" 1.13 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 1.14 + 1.15 + <script type="application/javascript" 1.16 + src="../common.js" /> 1.17 + <script type="application/javascript" 1.18 + src="../role.js" /> 1.19 + <script type="application/javascript" 1.20 + src="../states.js" /> 1.21 + <script type="application/javascript" 1.22 + src="../events.js" /> 1.23 + 1.24 + <script type="application/javascript"> 1.25 + <![CDATA[ 1.26 + function switchDeckPanel(aContainerID, aDeckID) 1.27 + { 1.28 + this.panelIndex = 0; 1.29 + 1.30 + this.container = getAccessible(aContainerID); 1.31 + this.deckNode = getNode(aDeckID); 1.32 + this.prevPanel = getAccessible(this.deckNode.selectedPanel); 1.33 + this.panelNode = this.deckNode.childNodes[this.panelIndex]; 1.34 + 1.35 + this.eventSeq = [ 1.36 + new invokerChecker(EVENT_HIDE, this.prevPanel), 1.37 + new invokerChecker(EVENT_SHOW, this.panelNode), 1.38 + new invokerChecker(EVENT_REORDER, this.container) 1.39 + ]; 1.40 + 1.41 + this.invoke = function switchDeckPanel_invoke() 1.42 + { 1.43 + var tree = 1.44 + { GROUPING: [ // role="group" 1.45 + { GROUPING: [ // groupbox, a selected panel #2 1.46 + { PUSHBUTTON: [ ] } // button 1.47 + ] } 1.48 + ] }; 1.49 + testAccessibleTree(this.container, tree); 1.50 + 1.51 + this.deckNode.selectedIndex = this.panelIndex; 1.52 + } 1.53 + 1.54 + this.finalCheck = function switchDeckPanel_finalCheck() 1.55 + { 1.56 + var tree = 1.57 + { GROUPING: [ // role="group" 1.58 + { LABEL: [ // description, a selected panel #1 1.59 + { TEXT_LEAF: [] } // text leaf, a description value 1.60 + ] } 1.61 + ] }; 1.62 + testAccessibleTree(this.container, tree); 1.63 + } 1.64 + 1.65 + this.getID = function switchDeckPanel_getID() 1.66 + { 1.67 + return "switch deck panel"; 1.68 + } 1.69 + } 1.70 + 1.71 + var gQueue = null; 1.72 + function doTest() 1.73 + { 1.74 + gQueue = new eventQueue(); 1.75 + gQueue.push(new switchDeckPanel("container", "deck")); 1.76 + gQueue.invoke(); // will call SimpleTest.finish(); 1.77 + } 1.78 + 1.79 + SimpleTest.waitForExplicitFinish(); 1.80 + addA11yLoadEvent(doTest); 1.81 + ]]> 1.82 + </script> 1.83 + 1.84 + <hbox flex="1" style="overflow: auto;"> 1.85 + <body xmlns="http://www.w3.org/1999/xhtml"> 1.86 + <a target="_blank" 1.87 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=814836" 1.88 + title=" xul:deck element messes up screen reader"> 1.89 + Mozilla Bug 814836 1.90 + </a> 1.91 + 1.92 + <p id="display"></p> 1.93 + <div id="content" style="display: none"> 1.94 + </div> 1.95 + <pre id="test"> 1.96 + </pre> 1.97 + </body> 1.98 + 1.99 + <vbox flex="1" id="container" role="group"> 1.100 + 1.101 + <deck id="deck" selectedIndex="1"> 1.102 + <description>This is the first page</description> 1.103 + <groupbox> 1.104 + <button label="This is the second page"/> 1.105 + </groupbox> 1.106 + </deck> 1.107 + 1.108 + </vbox> 1.109 + </hbox> 1.110 + 1.111 +</window> 1.112 +