Updated
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>doh.robot AccordionContainer A11Y Test</title>
|
||||
|
||||
<style>
|
||||
@import "../../../../util/doh/robot/robot.css";
|
||||
</style>
|
||||
|
||||
<!-- required: dojo.js -->
|
||||
<script type="text/javascript" src="../../../../dojo/dojo.js"
|
||||
djConfig="isDebug: true"></script>
|
||||
|
||||
<!-- functions to help test -->
|
||||
<script type="text/javascript" src="../../helpers.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
dojo.require("dijit.robotx");
|
||||
|
||||
dojo.ready(function(){
|
||||
doh.robot.initRobot('../test_AccordionContainer.html');
|
||||
doh.register("Accordion A11Y tests", [
|
||||
{
|
||||
name: "basic operation",
|
||||
timeout: 10000,
|
||||
runTest: function(t){
|
||||
var d = new doh.Deferred();
|
||||
doh.robot.sequence(function(){
|
||||
dojo.byId("beforeMarkupAccordion").focus();
|
||||
}, 500, 500);
|
||||
|
||||
// Tab into accordion, landing on title of first pane
|
||||
doh.robot.keyPress(dojo.keys.TAB, 500, {});
|
||||
doh.robot.sequence(d.getTestErrback(function(){
|
||||
doh.t(/A Simple Pane/.test(innerText(dojo.global.dijit.focus.curNode)), "tabbed to first pane's title");
|
||||
}), 500);
|
||||
|
||||
// Use down arrow to get to second pane's title
|
||||
doh.robot.keyPress(dojo.keys.DOWN_ARROW, 500, {});
|
||||
doh.robot.sequence(d.getTestErrback(function(){
|
||||
doh.f(/A Simple Pane/.test(innerText(dojo.global.dijit.focus.curNode)), "moved away from first pane's title");
|
||||
doh.t(/Lazy Load Pane/.test(innerText(dojo.global.dijit.focus.curNode)), "moved to second pane's title");
|
||||
doh.is("lazyLoadPane", dojo.global.dijit.byId("markupAccordion").get("selectedChildWidget").id, "second pane is now selected");
|
||||
}), 500);
|
||||
|
||||
// Workaround FF4 bug where overflow:auto panes get focus even when
|
||||
// they don't have a scrollbar, remove when
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=616594 fixed
|
||||
if(dojo.isFF == 4){
|
||||
dojo.query("#lazyLoadPane").style("overflow", "hidden");
|
||||
}
|
||||
|
||||
// Tab into second pane's content area, landing on link inside pane
|
||||
doh.robot.keyPress(dojo.keys.TAB, 500, {});
|
||||
doh.robot.sequence(d.getTestErrback(function(){
|
||||
doh.is("WebA11y", innerText(dojo.global.dijit.focus.curNode), "tabbed into second pane");
|
||||
}), 500);
|
||||
|
||||
// tab out of AccordionContainer
|
||||
doh.robot.keyPress(dojo.keys.TAB, 500, {});
|
||||
doh.robot.sequence(d.getTestCallback(function(){
|
||||
doh.is("afterMarkupAccordion", dojo.global.dijit.focus.curNode.id, "tabbed out of accordion");
|
||||
}), 500);
|
||||
|
||||
return d;
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
doh.run();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
||||
Reference in New Issue
Block a user