From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- chromium/base/test/gtest_xml_util.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'chromium/base/test/gtest_xml_util.cc') diff --git a/chromium/base/test/gtest_xml_util.cc b/chromium/base/test/gtest_xml_util.cc index 1bac5a6b1d2..620d9bafcee 100644 --- a/chromium/base/test/gtest_xml_util.cc +++ b/chromium/base/test/gtest_xml_util.cc @@ -32,6 +32,17 @@ static void XmlErrorFunc(void *context, const char *message, ...) { } // namespace +struct Link { + // The name of the test case. + std::string name; + // The name of the classname of the test. + std::string classname; + // The name of the link. + std::string link_name; + // The actual link. + std::string link; +}; + bool ProcessGTestOutput(const base::FilePath& output_file, std::vector* results, bool* crashed) { @@ -58,6 +69,8 @@ bool ProcessGTestOutput(const base::FilePath& output_file, STATE_END, } state = STATE_INIT; + std::vector links; + while (xml_reader.Read()) { xml_reader.SkipToElement(); std::string node_name(xml_reader.NodeName()); @@ -137,7 +150,26 @@ bool ProcessGTestOutput(const base::FilePath& output_file, results->pop_back(); } + for (const Link& link : links) { + if (link.name == test_name && link.classname == test_case_name) { + result.AddLink(link.link_name, link.link); + } + } + links.clear(); results->push_back(result); + } else if (node_name == "link" && !xml_reader.IsClosingElement()) { + Link link; + if (!xml_reader.NodeAttribute("name", &link.name)) + return false; + if (!xml_reader.NodeAttribute("classname", &link.classname)) + return false; + if (!xml_reader.NodeAttribute("link_name", &link.link_name)) + return false; + if (!xml_reader.ReadElementContent(&link.link)) + return false; + links.push_back(link); + } else if (node_name == "link" && xml_reader.IsClosingElement()) { + // Deliberately empty. } else if (node_name == "failure" && !xml_reader.IsClosingElement()) { std::string failure_message; if (!xml_reader.NodeAttribute("message", &failure_message)) -- cgit v1.2.1