Commit 3358a4f0 authored by Alexander Surkov's avatar Alexander Surkov Committed by Chromium LUCI CQ

a11y inspect: integrate dumpacc scripting into testsuite

Allow scripts to be used from accessibility dumptree tests

Bug: 1136957
Change-Id: I3d2a1e0fcd1a69266455062b462124fb7b7b3245
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2597000
Commit-Queue: Alexander Surkov <asurkov@igalia.com>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840591}
parent a2d1d7ae
...@@ -142,6 +142,18 @@ class DumpAccessibilityTreeTest : public DumpAccessibilityTestBase { ...@@ -142,6 +142,18 @@ class DumpAccessibilityTreeTest : public DumpAccessibilityTestBase {
RunTest(html_file, "accessibility/display-locking"); RunTest(html_file, "accessibility/display-locking");
} }
void RunMacTextMarkerTest(const base::FilePath::CharType* file_path) {
base::FilePath test_path =
GetTestFilePath("accessibility", "mac/textmarker");
{
base::ScopedAllowBlockingForTesting allow_blocking;
ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName();
}
base::FilePath html_file = test_path.Append(base::FilePath(file_path));
RunTest(html_file, "accessibility/mac/textmarker");
}
void RunRegressionTest(const base::FilePath::CharType* file_path) { void RunRegressionTest(const base::FilePath::CharType* file_path) {
base::FilePath test_path = GetTestFilePath("accessibility", "regression"); base::FilePath test_path = GetTestFilePath("accessibility", "regression");
base::FilePath test_file = test_path.Append(base::FilePath(file_path)); base::FilePath test_file = test_path.Append(base::FilePath(file_path));
...@@ -2583,6 +2595,22 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, DeleteSelectionCrash) { ...@@ -2583,6 +2595,22 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, DeleteSelectionCrash) {
RunHtmlTest(FILE_PATH_LITERAL("delete-selection-crash.html")); RunHtmlTest(FILE_PATH_LITERAL("delete-selection-crash.html"));
} }
#if defined(OS_MAC)
//
// NSAccessibility specific tests
//
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AXStartTextMarker) {
RunMacTextMarkerTest(FILE_PATH_LITERAL("AXStartTextMarker.html"));
}
#endif
//
// DisplayLocking tests
//
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, DisplayLockingActivatable) { IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, DisplayLockingActivatable) {
RunDisplayLockingTest(FILE_PATH_LITERAL("activatable.html")); RunDisplayLockingTest(FILE_PATH_LITERAL("activatable.html"));
} }
......
...@@ -194,6 +194,13 @@ bool DumpAccessibilityTestHelper::ParsePropertyFilter( ...@@ -194,6 +194,13 @@ bool DumpAccessibilityTestHelper::ParsePropertyFilter(
return true; return true;
} }
directive = mapping->directive_prefix + "-SCRIPT:";
if (base::StartsWith(line, directive, base::CompareCase::SENSITIVE)) {
filters->emplace_back(line.substr(directive.size()),
AXPropertyFilter::SCRIPT);
return true;
}
directive = mapping->directive_prefix + "-DENY:"; directive = mapping->directive_prefix + "-DENY:";
if (base::StartsWith(line, directive, base::CompareCase::SENSITIVE)) { if (base::StartsWith(line, directive, base::CompareCase::SENSITIVE)) {
filters->emplace_back(line.substr(directive.size()), filters->emplace_back(line.substr(directive.size()),
......
<!--
@MAC-DENY-NODE:*=*
@MAC-SCRIPT:p.AXStartTextMarker
-->
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<p id="p">Paragraph</p>
</body>
</html>
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