<html>
<head>
<style>
/*Supplemental: CSS for the YUI distribution*/
#custom-doc { width: 95%; min-width: 950px; }
#mychart {
padding:10px 10px 10px 10px;
}
</style>
</head>
<body class="yui3-skin-sam">
<h3>Aria Line Tests</h3>
<div id="mychart"></div>
<script>
YUI({
allowRollup: false,
filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'min'
}).use('charts', 'test', 'console', function (Y)
{
var suite = new Y.Test.Suite("Y.Charts.AriaLine"),
myDataValues = [
],
pieDataValues = [
],
defaultAriaDescription = "Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",
defaultPieAriaDescription = "Use the left and right keys to navigate through items.",
seriesKeys = ["values", "revenue"],
width = 400,
height = 300;
function AriaTests(cfg, testConfig)
{
this.attrConfig = cfg;
this.name = testConfig.type + " Aria Tests";
}
Y.extend(AriaTests, Y.Test.Case, {
defaultAriaLabel: "Chart Application",
changedAriaLabel: "This is a new ariaLabel value.",
setUp: function() {
var mychart = new Y.Chart(this.attrConfig);
this.chart = mychart;
},
tearDown: function() {
},
"test:getAriaLabel()": function()
{
},
"test:setAriaLabel()": function()
{
var chart = this.chart;
chart.set("ariaLabel", this.changedAriaLabel);
},
"test:getAriaDescription()": function()
{
},
"test:setAriaDescription()": function()
{
var chart = this.chart;
chart.set("ariaDescription", this.changedAriaLabel);
}
});
Y.AriaTests = AriaTests;
var comboTests = new Y.AriaTests({
dataProvider: myDataValues,
render: "#mychart",
type: "combo",
width: width,
height: height
}, {
type: "Combo",
defaultAriaDescription: defaultAriaDescription
}),
stackedComboTests = new Y.AriaTests({
dataProvider: myDataValues,
render: "#mychart",
type: "combo",
stacked: true,
width: width,
height: height
}, {
type: "StackedCombo",
defaultAriaDescription: defaultAriaDescription
}),
areaTests = new Y.AriaTests({
dataProvider: myDataValues,
render: "#mychart",
type: "area",
width: width,
height: height
}, {
type: "Area",
defaultAriaDescription: defaultAriaDescription
}),
stackedAreaTests = new Y.AriaTests({
dataProvider: myDataValues,
render: "#mychart",
type: "area",
stacked: true,
width: width,
height: height
}, {
type: "StackedArea",
defaultAriaDescription: defaultAriaDescription
}),
lineTests = new Y.AriaTests({
dataProvider: myDataValues,
render: "#mychart",
type: "line",
width: width,
height: height
}, {
type: "Line",
defaultAriaDescription: defaultAriaDescription
}),
stackedLineTests = new Y.AriaTests({
dataProvider: myDataValues,
render: "#mychart",
type: "line",
stacked: true,
width: width,
height: height
}, {
type: "StackedLine",
defaultAriaDescription: defaultAriaDescription
}),
markerTests = new Y.AriaTests({
dataProvider: myDataValues,
render: "#mychart",
type: "markerseries",
width: width,
height: height
}, {
type: "Marker",
defaultAriaDescription: defaultAriaDescription
}),
stackedMarkerTests = new Y.AriaTests({
dataProvider: myDataValues,
render: "#mychart",
type: "markerseries",
stacked: true,
width: width,
height: height
}, {
type: "StackedMarker",
defaultAriaDescription: defaultAriaDescription
});
suite.add(comboTests);
suite.add(stackedComboTests);
suite.add(areaTests);
suite.add(stackedAreaTests);
suite.add(lineTests);
suite.add(stackedLineTests);
suite.add(markerTests);
suite.add(stackedMarkerTests);
//create the console
var r = new Y.Console({
newestOnTop : false,
style: 'block' // to anchor in the example content
});
r.render('#testLogger');
//run the tests
Y.Test.Runner.add(suite);
});
</script>
</body>
</html>