1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/events/test_focus_tabbox.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="Tabbox focus testing"> 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"/> 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="../states.js" /> 1.23 + <script type="application/javascript" 1.24 + src="../events.js" /> 1.25 + 1.26 + <script type="application/javascript"> 1.27 + //gA11yEventDumpID = "eventdump"; // debug stuff 1.28 + //gA11yEventDumpToConsole = true; // debug stuff 1.29 + 1.30 + var gQueue = null; 1.31 + function doTests() 1.32 + { 1.33 + if (MAC) { 1.34 + todo(false, "Tests disabled because of imminent failure."); 1.35 + SimpleTest.finish(); 1.36 + return; 1.37 + } 1.38 + 1.39 + // Test focus events. 1.40 + gQueue = new eventQueue(); 1.41 + 1.42 + var textbox = getNode("textbox").inputField; 1.43 + gQueue.push(new synthClick("tab1", new focusChecker("tab1"))); 1.44 + gQueue.push(new synthTab("tab1", new focusChecker("checkbox1"))); 1.45 + gQueue.push(new synthKey("tab1", "VK_TAB", { ctrlKey: true }, 1.46 + new focusChecker(textbox))); 1.47 + gQueue.push(new synthKey("tab2", "VK_TAB", { ctrlKey: true }, 1.48 + new focusChecker("tab3"))); 1.49 + gQueue.push(new synthKey("tab3", "VK_TAB", { ctrlKey: true }, 1.50 + new focusChecker("tab1"))); 1.51 + 1.52 + gQueue.invoke(); // Will call SimpleTest.finish(); 1.53 + } 1.54 + 1.55 + SimpleTest.waitForExplicitFinish(); 1.56 + addA11yLoadEvent(doTests); 1.57 + </script> 1.58 + 1.59 + <hbox flex="1" style="overflow: auto;"> 1.60 + <body xmlns="http://www.w3.org/1999/xhtml"> 1.61 + <a target="_blank" 1.62 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=370396" 1.63 + title="Control+Tab to an empty tab panel in a tabbox causes focus to leave the tabbox"> 1.64 + Mozilla Bug 370396 1.65 + </a> 1.66 + <p id="display"></p> 1.67 + <div id="content" style="display: none"></div> 1.68 + <pre id="test"> 1.69 + </pre> 1.70 + </body> 1.71 + 1.72 + <vbox flex="1"> 1.73 + <tabbox> 1.74 + <tabs> 1.75 + <tab id="tab1" label="Tab1" selected="true"/> 1.76 + <tab id="tab2" label="Tab2" /> 1.77 + <tab id="tab3" label="Tab3" /> 1.78 + </tabs> 1.79 + <tabpanels> 1.80 + <tabpanel orient="vertical"> 1.81 + <groupbox orient="vertical"> 1.82 + <checkbox id="checkbox1" label="Monday" width="75"/> 1.83 + <checkbox label="Tuesday" width="75"/> 1.84 + <checkbox label="Wednesday" width="75"/> 1.85 + <checkbox label="Thursday" width="75"/> 1.86 + <checkbox label="Friday" width="75"/> 1.87 + <checkbox label="Saturday" width="75"/> 1.88 + <checkbox label="Sunday" width="75"/> 1.89 + </groupbox> 1.90 + 1.91 + <spacer style="height: 10px" /> 1.92 + <label value="Label After checkboxes" /> 1.93 + </tabpanel> 1.94 + <tabpanel orient="vertical"> 1.95 + <textbox id="textbox" /> 1.96 + </tabpanel> 1.97 + <tabpanel orient="vertical"> 1.98 + <description>Tab 3 content</description> 1.99 + </tabpanel> 1.100 + </tabpanels> 1.101 + </tabbox> 1.102 + 1.103 + <vbox id="eventdump"/> 1.104 + </vbox> 1.105 + </hbox> 1.106 +</window>