From 2fb432b73592c91e01ed598963d6fb55b508a9a7 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Fri, 11 Nov 2022 12:07:52 -0800 Subject: [PATCH] test: Fix XML parser security tests on Xbox (#4695) Xbox seems to treat SVG and/or XML a little differently than other platforms, which led to a test failure on that platform. That went unnoticed because Xbox is offline in our lab. The issue was discovered while working to restore that platform in the lab test runs. --- test/util/xml_utils_unit.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/util/xml_utils_unit.js b/test/util/xml_utils_unit.js index 57e1269071..d89275b543 100644 --- a/test/util/xml_utils_unit.js +++ b/test/util/xml_utils_unit.js @@ -425,10 +425,15 @@ describe('XmlUtils', () => { }); it('returns null on XML that embeds SVG', () => { + // Some platforms, such as Xbox One, don't recognize elements as SVG + // based on namespace alone. So the SVG element below needs to be a real + // SVG element. const xmlString = [ '', '', - ' ', + ' ', + ' ', + ' ', '', ].join('\n'); const doc = XmlUtils.parseXmlString(xmlString, 'Root');