@@ -338,115 +338,3 @@ addAccessibleTask(
338338 is ( select . getAttributeValue ( "AXSelectedChildren" ) . length , 0 ) ;
339339 }
340340) ;
341-
342- addAccessibleTask (
343- `<div role="listbox" id="select" aria-label="Choose a number">
344- <div id="groupOne" role="grouping">
345- <div role="option" id="one" aria-selected="true">One</div>
346- </div>
347- <div id="groupTwo" role="grouping">
348- <div role="option" id="two" aria-selected="false">Two</div>
349- </div>
350- <div id="groupThree" role="grouping">
351- <div role="option" id="three" aria-selected="false">Three</div>
352- </div>
353- </div>` ,
354- async function testGroupedListbox ( browser , accDoc ) {
355- let select = getNativeInterface ( accDoc , "select" ) ;
356- let one = getNativeInterface ( accDoc , "one" ) ;
357- let two = getNativeInterface ( accDoc , "two" ) ;
358-
359- // Check the listbox
360- is (
361- select . getAttributeValue ( "AXTitle" ) ,
362- "Choose a number" ,
363- "Select titled correctly"
364- ) ;
365- ok (
366- select . isAttributeSettable ( "AXSelectedChildren" ) ,
367- "Select can have AXSelectedChildren set"
368- ) ;
369- // Check the first option
370- is (
371- one . getAttributeValue ( "AXValue" ) ,
372- "One" ,
373- "First option has correct value"
374- ) ;
375- is (
376- one . getAttributeValue ( "AXSelected" ) ,
377- 1 ,
378- "The first option has selected state"
379- ) ;
380- // Check the second option
381- is (
382- two . getAttributeValue ( "AXValue" ) ,
383- "Two" ,
384- "Second option has correct value"
385- ) ;
386- is (
387- two . getAttributeValue ( "AXSelected" ) ,
388- 0 ,
389- "The second option has no selected state"
390- ) ;
391- // Check the relationship between the listbox and its selected children
392- is (
393- select . getAttributeValue ( "AXSelectedChildren" ) . length ,
394- 1 ,
395- "Listbox has one selected child"
396- ) ;
397- let selectedChild = select . getAttributeValue ( "AXSelectedChildren" ) [ 0 ] ;
398- is (
399- selectedChild . getAttributeValue ( "AXValue" ) ,
400- "One" ,
401- "The first option is the selected child"
402- ) ;
403-
404- let evt = waitForMacEvent ( "AXSelectedChildrenChanged" ) ;
405- // Remove all selection.
406- await SpecialPowers . spawn ( browser , [ ] , ( ) => {
407- content . document
408- . getElementById ( "one" )
409- . setAttribute ( "aria-selected" , "false" ) ;
410- } ) ;
411- await evt ;
412- // Check the relationship between the listbox and its selected children
413- // after removing all selection.
414- is (
415- select . getAttributeValue ( "AXSelectedChildren" ) . length ,
416- 0 ,
417- "Listbox has no selected child"
418- ) ;
419- is (
420- one . getAttributeValue ( "AXSelected" ) ,
421- 0 ,
422- "The first option has no selected state"
423- ) ;
424-
425- evt = waitForMacEvent ( "AXSelectedChildrenChanged" ) ;
426- // Modify listbox so the second item is selected.
427- await SpecialPowers . spawn ( browser , [ ] , ( ) => {
428- content . document
429- . getElementById ( "two" )
430- . setAttribute ( "aria-selected" , "true" ) ;
431- } ) ;
432- await evt ;
433- // Check the relationship between the listbox and its selected children
434- // after selecting the second option.
435- is (
436- select . getAttributeValue ( "AXSelectedChildren" ) . length ,
437- 1 ,
438- "Listbox has one selected child"
439- ) ;
440- selectedChild = select . getAttributeValue ( "AXSelectedChildren" ) [ 0 ] ;
441- is (
442- selectedChild . getAttributeValue ( "AXValue" ) ,
443- "Two" ,
444- "The second option is the selected child"
445- ) ;
446- is (
447- two . getAttributeValue ( "AXSelected" ) ,
448- 1 ,
449- "The second option has selected state"
450- ) ;
451- }
452- ) ;
0 commit comments