browser_text.js (1190B)
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 that IA2_TEXT_BOUNDARY_CHAR moves by cluster. 9 */ 10 addAccessibleTask(`<p id="cluster">a🤦♂️c`, async function testChar() { 11 await runPython(` 12 doc = getDocIa2() 13 global cluster 14 cluster = findIa2ByDomId(doc, "cluster") 15 cluster = cluster.QueryInterface(IAccessibleText) 16 `); 17 SimpleTest.isDeeply( 18 await runPython(`cluster.textAtOffset(0, IA2_TEXT_BOUNDARY_CHAR)`), 19 [0, 1, "a"], 20 "textAtOffset at 0 for CHAR correct" 21 ); 22 SimpleTest.isDeeply( 23 await runPython(`cluster.textAtOffset(1, IA2_TEXT_BOUNDARY_CHAR)`), 24 [1, 6, "🤦♂️"], 25 "textAtOffset at 1 for CHAR correct" 26 ); 27 SimpleTest.isDeeply( 28 await runPython(`cluster.textAtOffset(5, IA2_TEXT_BOUNDARY_CHAR)`), 29 [1, 6, "🤦♂️"], 30 "textAtOffset at 5 for CHAR correct" 31 ); 32 SimpleTest.isDeeply( 33 await runPython(`cluster.textAtOffset(6, IA2_TEXT_BOUNDARY_CHAR)`), 34 [6, 7, "c"], 35 "textAtOffset at 6 for CHAR correct" 36 ); 37 });