summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-04-07 20:18:25 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-04-08 08:11:02 +0200
commitfeeed3e762cf077fbd9cf48f82e949365108ccc1 (patch)
tree12d0ea15a7656b49291303366fe08a07b81e3088 /sw/qa
parentb426a8a4c672c20e515f1ce24404530748cc4df0 (diff)
CppunitTest_sw_layoutwriter: avoid some a11y-based layout testing
The contents of SwTextFrames are currently dumped two times in the sw xml layout dump: the first is misusing a11y's SwPortionHandler interface for testing purposes (older approach), the second is visiting the portions inside the text frame directly (newer approach). The advantage of the second is that it can show information inside multi-portions, and also extending it won't affect a11y. This commit updates some asserts to use the second -- the first can be removed once no asserts depend on it. Change-Id: I5112946a964f338fc873ba13300023de9418e837 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132687 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/layout/layout.cxx54
1 files changed, 36 insertions, 18 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index e02f0202f406..288288c90b46 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -59,26 +59,44 @@ void SwLayoutWriter::CheckRedlineFootnotesHidden()
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "24");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "PortionType::Footnote");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", "PortionType::Footnote");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "rText", "2");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
+ "type", "PortionType::Footnote");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
+ "expand", "1");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
+ "type", "PortionType::Text");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
+ "portion", "foaz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
+ "type", "PortionType::Footnote");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
+ "expand", "2");
assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", "13");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType",
- "PortionType::FootnoteNum");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[1]", "nType",
- "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[1]", "Portion", "ac");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
+ "type", "PortionType::FootnoteNum");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
+ "expand", "1");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
+ "type", "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
+ "portion", "ac");
assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/merged", "paraPropsNodeIndex", "16");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "nType",
- "PortionType::FootnoteNum");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "rText", "2");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType",
- "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "Portion", "mo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
+ "type", "PortionType::FootnoteNum");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
+ "expand", "2");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
+ "type", "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
+ "portion", "mo");
}
void SwLayoutWriter::CheckRedlineSectionsHidden()