From 084b2c17ddae48d757efc5d34849902115b5b46a Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Fri, 11 Jun 2021 18:10:40 +0000 Subject: [PATCH] Bug 1542807 part 7 - Update a11y tests. r=eeejay Differential Revision: https://phabricator.services.mozilla.com/D114129 --- accessible/tests/mochitest/common.js | 2 +- accessible/tests/mochitest/name/test_list.html | 18 ++++++++++++++++-- .../mochitest/text/test_paragraphboundary.html | 6 +++++- .../mochitest/textattrs/test_general.html | 6 +++++- accessible/tests/mochitest/tree/test_list.html | 4 ++-- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/accessible/tests/mochitest/common.js b/accessible/tests/mochitest/common.js index f997cbfa0e95..21e56c766030 100644 --- a/accessible/tests/mochitest/common.js +++ b/accessible/tests/mochitest/common.js @@ -96,7 +96,7 @@ const kEmbedChar = String.fromCharCode(0xfffc); const kDiscBulletChar = String.fromCharCode(0x2022); const kDiscBulletText = kDiscBulletChar + " "; const kCircleBulletText = String.fromCharCode(0x25e6) + " "; -const kSquareBulletText = String.fromCharCode(0x25fe) + " "; +const kSquareBulletText = String.fromCharCode(0x25aa) + " "; const MAX_TRIM_LENGTH = 100; diff --git a/accessible/tests/mochitest/name/test_list.html b/accessible/tests/mochitest/name/test_list.html index 86afef66b2db..95f0c06d2aa5 100644 --- a/accessible/tests/mochitest/name/test_list.html +++ b/accessible/tests/mochitest/name/test_list.html @@ -35,7 +35,18 @@ this.finalCheck = function bulletUpdate_finalCheck() { testName("li_start", "1. list start"); testName("li_end", "2. list end"); + }; + this.getID = function bulletUpdate_getID() { + return "insertBefore new list item"; + }; + } + function bulletUpdate2() { + this.eventSeq = [ + new invokerChecker(EVENT_REORDER, getNode("li_end")), + ]; + + this.invoke = function bulletUpdate2_invoke() { // change list style type var list = getNode("list"); list.setAttribute("style", "list-style-type: disc;"); @@ -46,13 +57,15 @@ // nsTextFrame::GetRenderedText to report the text of a text // frame is empty. list.offsetWidth; // flush layout (which also flushes style) + }; + this.finalCheck = function bulletUpdate2_finalCheck() { testName("li_start", kDiscBulletText + "list start"); testName("li_end", kDiscBulletText + "list end"); }; - this.getID = function bulletUpdate_getID() { - return "Update bullet of list items"; + this.getID = function bulletUpdate2_getID() { + return "Update list item style"; }; } @@ -60,6 +73,7 @@ function doTest() { gQueue = new eventQueue(); gQueue.push(new bulletUpdate()); + gQueue.push(new bulletUpdate2()); gQueue.invoke(); // SimpleTest.finish(); } diff --git a/accessible/tests/mochitest/text/test_paragraphboundary.html b/accessible/tests/mochitest/text/test_paragraphboundary.html index 9a9f546e9659..7a8bac2a688a 100644 --- a/accessible/tests/mochitest/text/test_paragraphboundary.html +++ b/accessible/tests/mochitest/text/test_paragraphboundary.html @@ -56,7 +56,9 @@ [[0, 0, kEmbedChar, 0, 1], [1, 2, kEmbedChar, 1, 2]]); testTextAtOffset("li1", BOUNDARY_PARAGRAPH, - [[0, 3, "• a", 0, 3]]); + [[0, 0, "• ", 0, 2], [2, 3, "a", 2, 3]]); + testTextAtOffset("li2", BOUNDARY_PARAGRAPH, + [[0, 0, "• ", 0, 2], [2, 3, "a", 2, 3]]); // Test line breaks in a textarea. testTextAtOffset("textarea", BOUNDARY_PARAGRAPH, @@ -125,6 +127,8 @@

ab
c
d

+ +