browser_actions_domain.js (1595B)
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 // CacheKey::AccessKey, CacheDomain::Actions 8 addAccessibleTask( 9 `<div id="test" accesskey="x">test</div>`, 10 async function (browser, docAcc) { 11 let acc = findAccessibleChildByID(docAcc, "test"); 12 await testAttributeCachePresence(acc, "accesskey", () => { 13 acc.accessKey; 14 }); 15 }, 16 { 17 topLevel: true, 18 iframe: false, // AccessKey issues with iframe - See Bug 1796846 19 remoteIframe: true, 20 cacheDomains: CacheDomain.None, 21 } 22 ); 23 24 // CacheKey::HasLongdesc, CacheDomain::Actions 25 addAccessibleTask( 26 `<img id="test" src="http://example.com/a11y/accessible/tests/mochitest/moz.png" longdesc="http://example.com">`, 27 async function (browser, docAcc) { 28 let acc = findAccessibleChildByID(docAcc, "test"); 29 await testAttributeCachePresence(acc, "longdesc", () => { 30 acc.actionCount; 31 }); 32 }, 33 { 34 topLevel: true, 35 iframe: true, 36 remoteIframe: true, 37 cacheDomains: CacheDomain.None, 38 } 39 ); 40 41 // CacheKey::PrimaryAction, CacheDomain::Actions 42 addAccessibleTask( 43 `<button id="test" onclick="console.log('test');">test</button>`, 44 async function (browser, docAcc) { 45 let acc = findAccessibleChildByID(docAcc, "test"); 46 await testAttributeCachePresence(acc, "action", () => { 47 acc.actionCount; 48 }); 49 }, 50 { 51 topLevel: true, 52 iframe: true, 53 remoteIframe: true, 54 cacheDomains: CacheDomain.None, 55 } 56 );