browser_caching_interfaces.js (1754B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 /** 8 * Test caching of accessible interfaces 9 */ 10 addAccessibleTask( 11 ` 12 <img id="img" src="http://example.com/a11y/accessible/tests/mochitest/moz.png"> 13 <select id="select" multiple></select> 14 <input id="number-input" type="number"> 15 <table id="table"> 16 <tr><td id="cell"><a id="link" href="#">hello</a></td></tr> 17 </table> 18 `, 19 async function (browser, accDoc) { 20 ok( 21 accDoc instanceof nsIAccessibleDocument, 22 "Document has Document interface" 23 ); 24 ok( 25 accDoc instanceof nsIAccessibleHyperText, 26 "Document has HyperText interface" 27 ); 28 ok( 29 findAccessibleChildByID(accDoc, "img") instanceof nsIAccessibleImage, 30 "img has Image interface" 31 ); 32 ok( 33 findAccessibleChildByID(accDoc, "select") instanceof 34 nsIAccessibleSelectable, 35 "select has Selectable interface" 36 ); 37 ok( 38 findAccessibleChildByID(accDoc, "number-input") instanceof 39 nsIAccessibleValue, 40 "number-input has Value interface" 41 ); 42 ok( 43 findAccessibleChildByID(accDoc, "table") instanceof nsIAccessibleTable, 44 "table has Table interface" 45 ); 46 ok( 47 findAccessibleChildByID(accDoc, "cell") instanceof nsIAccessibleTableCell, 48 "cell has TableCell interface" 49 ); 50 ok( 51 findAccessibleChildByID(accDoc, "link") instanceof nsIAccessibleHyperLink, 52 "link has HyperLink interface" 53 ); 54 ok( 55 findAccessibleChildByID(accDoc, "link") instanceof nsIAccessibleHyperText, 56 "link has HyperText interface" 57 ); 58 } 59 );