gecko/accessible/tests/mochitest/name/nsRootAcc_wnd.xul
Alexander Surkov d56619b51b Bug 613131 - role nothing should allow recursive name calculation from children, r=fer, davidb, marcoz, a=davidb
--HG--
rename : accessible/tests/mochitest/name.css => accessible/tests/mochitest/name/general.css
rename : accessible/tests/mochitest/name.xbl => accessible/tests/mochitest/name/general.xbl
rename : accessible/tests/mochitest/name.js => accessible/tests/mochitest/name/markup.js
rename : accessible/tests/mochitest/namerules.xml => accessible/tests/mochitest/name/markuprules.xml
rename : accessible/tests/mochitest/name_nsRootAcc_wnd.xul => accessible/tests/mochitest/name/nsRootAcc_wnd.xul
rename : accessible/tests/mochitest/test_name_button.html => accessible/tests/mochitest/name/test_button.html
rename : accessible/tests/mochitest/test_name.html => accessible/tests/mochitest/name/test_general.html
rename : accessible/tests/mochitest/test_name.xul => accessible/tests/mochitest/name/test_general.xul
rename : accessible/tests/mochitest/test_name_link.html => accessible/tests/mochitest/name/test_link.html
rename : accessible/tests/mochitest/test_name_markup.html => accessible/tests/mochitest/name/test_markup.html
rename : accessible/tests/mochitest/test_name_nsRootAcc.xul => accessible/tests/mochitest/name/test_nsRootAcc.xul
2010-11-21 09:02:16 +08:00

126 lines
3.5 KiB
XML

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<!-- Firefox tabbrowser -->
<?xml-stylesheet href="chrome://browser/content/browser.css"
type="text/css"?>
<!-- SeaMonkey tabbrowser -->
<?xml-stylesheet href="chrome://navigator/content/navigator.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript">
<![CDATA[
var gOpenerWnd = window.opener.wrappedJSObject;
function ok(aCond, aMsg) {
gOpenerWnd.SimpleTest.ok(aCond, aMsg);
}
function is(aExpected, aActual, aMsg) {
gOpenerWnd.SimpleTest.is(aExpected, aActual, aMsg);
}
// Hacks to make xul:tabbrowser work.
var handleDroppedLink = null; // needed for tabbrowser usage
Components.utils.import("resource://gre/modules/Services.jsm");
var XULBrowserWindow = {
isBusy: false,
setOverLink: function (link, b) {
}
};
gFindBarInitialized = false;
////////////////////////////////////////////////////////////////////////////
// Invoker implementation.
function switchTabSelectChecker(aInvoker)
{
this.type = "select";
Object.defineProperty(this, "target", { get: function() { return aInvoker.getTabsElm(); }});
this.getID = function() { return "switch tab, select event"; }
}
function switchTabFocusChecker(aInvoker)
{
this.type = gOpenerWnd.EVENT_FOCUS;
Object.defineProperty(this, "target", { get: function() { return aInvoker.getContentDoc(); }});
this.check = function(aEvent)
{
is(gOpenerWnd.getAccessible(document).name, "about:mozilla" + aEvent.accessible.name,
"Oops almost :)");
}
this.getID = function() { return "switch tab, focus event"; }
}
function switchTabInvoker(aTabBrowser, aWindow)
{
this.invoke = function switchTabInvoker_invoke()
{
gOpenerWnd.synthesizeKey("VK_TAB", { ctrlKey: true }, aWindow);
}
this.eventSeq = [
new switchTabSelectChecker(this),
new switchTabFocusChecker(this)
];
this.getContentDoc = function switchTabInvoker_getContentDoc()
{
return aTabBrowser.getBrowserAtIndex(1).contentDocument;
}
this.getTabsElm = function switchTabInvoker_getTabsElm()
{
return aTabBrowser.tabContainer;
}
}
////////////////////////////////////////////////////////////////////////////
// Tests
var gQueue = null;
const Ci = Components.interfaces;
function doTest()
{
var tabBrowser = document.getElementById("content");
tabBrowser.loadURI("about:robots");
tabBrowser.addTab("about:mozilla");
gQueue = new gOpenerWnd.eventQueue();
gQueue.push(new switchTabInvoker(tabBrowser, window));
gQueue.onFinish = function() { window.close(); }
gQueue.invoke();
}
gOpenerWnd.addA11yLoadEvent(doTest);
]]>
</script>
<!-- Hack to make xul:tabbrowser work -->
<menubar>
<menu label="menu">
<menupopup>
<menuitem label="close window hook" id="menu_closeWindow"/>
<menuitem label="close hook" id="menu_close"/>
</menupopup>
</menu>
</menubar>
<tabs id="tabbrowser-tabs" class="tabbrowser-tabs"
tabbrowser="content"
flex="1"
setfocus="false">
<tab class="tabbrowser-tab" selected="true"/>
</tabs>
<tabbrowser id="content"
type="content-primary"
tabcontainer="tabbrowser-tabs"
flex="1"/>
</window>