Commit 2e6a440d authored by Alexander Surkov's avatar Alexander Surkov Committed by Commit Bot

DumpAccTree testsuite: convert utf16 to utf8 in NodeFilter

Bug: 1115489
Change-Id: I0987625fcb7a2c46ee13aa276f6ab1ddaae6d072
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363883Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Alexander Surkov <asurkov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#803702}
parent cdb7f942
......@@ -345,7 +345,7 @@ bool AccessibilityTreeFormatter::MatchesNodeFilters(
const std::vector<NodeFilter>& node_filters,
const base::DictionaryValue& dict) {
for (const auto& filter : node_filters) {
base::string16 value;
std::string value;
if (!dict.GetString(filter.property, &value)) {
continue;
}
......
......@@ -187,8 +187,7 @@ void DumpAccessibilityTestBase::ParseHtmlForExtraDirectives(
node_filter, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
// Silently skip over parsing errors like the rest of the enclosing code.
if (parts.size() == 2) {
node_filters_.push_back(
NodeFilter(parts[0], base::UTF8ToUTF16(parts[1])));
node_filters_.emplace_back(parts[0], parts[1]);
}
} else if (base::StartsWith(line, no_load_expected_str,
base::CompareCase::SENSITIVE)) {
......
......@@ -14,7 +14,6 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/process/process_handle.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
......@@ -92,9 +91,9 @@ class CONTENT_EXPORT AccessibilityTreeFormatter
// {property='internalRole', pattern='inlineTextBox'};
struct NodeFilter {
std::string property;
base::string16 pattern;
std::string pattern;
NodeFilter(std::string property, base::string16 pattern)
NodeFilter(const std::string& property, const std::string& pattern)
: property(property), pattern(pattern) {}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment