### Eclipse Workspace Patch 1.0 #P jQuery Index: demos/slider/multiple-handles.html =================================================================== --- demos/slider/multiple-handles.html (revision 0) +++ demos/slider/multiple-handles.html (revision 0) @@ -0,0 +1,51 @@ + + +
++ + +
+ + + +Set the range
option to true to capture a range of values with two drag handles. The space between the handles is filled with a different background color to indicate those values are selected.
Index: tests/unit/slider/slider_core.js =================================================================== --- tests/unit/slider/slider_core.js (revision 3816) +++ tests/unit/slider/slider_core.js (working copy) @@ -289,4 +289,83 @@ el.slider("destroy"); }); +test("ARIA Min and Max", function() { + el = $('
'); + + options = { + max: 54, + min: 3, + orientation: 'horizontal', + value:15 + }; + + el.slider(options); + var handles = handle(); + + equals(handles.attr("aria-valuemax"), 54, "The ARIA-valuemax should be 54" ); + equals(handles.attr("aria-valuemin"), 3, "The ARIA-valuemin should be 3" ); + equals(handles.attr("aria-valuenow"), 15, "The ARIA-valuenow should be 15" ); + el.slider('destroy'); +}); + +test("ARIA Min and Max with default options", function() { + el = $(''); + + el.slider(); + var handles = handle(); + + equals(handles.attr("aria-valuemax"), 100, "The ARIA max should be 100" ); + equals(handles.attr("aria-valuemin"), 0, "The ARIA min should be 0" ); + equals(handles.attr("aria-valuenow"), 0, "The ARIA-valuenow should be 0" ); + el.slider('destroy'); +}); + +test("ARIA-valuenow after keydown LEFT", function(){ + el = $(''); + options = { + max: 5, + min: -5, + orientation: 'horizontal', + step: 1, + value: 4 + }; + el.slider(options); + var handles = handle(); + + el.slider(options.value, options.min + options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT }); + equals(handles.attr("aria-valuenow"), 3, "The ARIA-valuenow should be 3" ); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT }); + equals(handles.attr("aria-valuenow"), 2, "The ARIA-valuenow should be 2" ); + + el.slider("destroy"); + +}); + +test("ARIA-valuenow after keydown RIGHT", function(){ + el = $(''); + options = { + max: 5, + min: -5, + orientation: 'horizontal', + step: 1, + value: 2 + }; + el.slider(options); + var handles = handle(); + + el.slider(options.value, options.min + options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT }); + equals(handles.attr("aria-valuenow"), 3, "The ARIA-valuenow should be 3" ); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT }); + equals(handles.attr("aria-valuenow"), 4, "The ARIA-valuenow should be 4" ); + + el.slider("destroy"); + +}); + })(jQuery);