Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: content/browser/accessibility/dump_accessibility_tree_browsertest.cc

Issue 2833843005: Handling of different types of empty alt (Closed)
Patch Set: Ready to land Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // 2. Read the expectation. 52 // 2. Read the expectation.
53 // 3. Browse to the page and serialize the platform specific tree into a human 53 // 3. Browse to the page and serialize the platform specific tree into a human
54 // readable string. 54 // readable string.
55 // 4. Perform a comparison between actual and expected and fail if they do not 55 // 4. Perform a comparison between actual and expected and fail if they do not
56 // exactly match. 56 // exactly match.
57 class DumpAccessibilityTreeTest : public DumpAccessibilityTestBase { 57 class DumpAccessibilityTreeTest : public DumpAccessibilityTestBase {
58 public: 58 public:
59 void AddDefaultFilters(std::vector<Filter>* filters) override { 59 void AddDefaultFilters(std::vector<Filter>* filters) override {
60 filters->push_back(Filter(base::ASCIIToUTF16("FOCUSABLE"), Filter::ALLOW)); 60 filters->push_back(Filter(base::ASCIIToUTF16("FOCUSABLE"), Filter::ALLOW));
61 filters->push_back(Filter(base::ASCIIToUTF16("READONLY"), Filter::ALLOW)); 61 filters->push_back(Filter(base::ASCIIToUTF16("READONLY"), Filter::ALLOW));
62 filters->push_back(Filter(base::ASCIIToUTF16("name=*"), Filter::ALLOW));
63 filters->push_back(Filter(base::ASCIIToUTF16("roleDescription=*"), 62 filters->push_back(Filter(base::ASCIIToUTF16("roleDescription=*"),
64 Filter::ALLOW)); 63 Filter::ALLOW));
65 filters->push_back(Filter(base::ASCIIToUTF16("*=''"), Filter::DENY)); 64 filters->push_back(Filter(base::ASCIIToUTF16("*=''"), Filter::DENY));
65 // After denying empty values, because we want to allow name=''
66 filters->push_back(
67 Filter(base::ASCIIToUTF16("name=*"), Filter::ALLOW_EMPTY));
66 } 68 }
67 69
68 void SetUpCommandLine(base::CommandLine* command_line) override { 70 void SetUpCommandLine(base::CommandLine* command_line) override {
69 DumpAccessibilityTestBase::SetUpCommandLine(command_line); 71 DumpAccessibilityTestBase::SetUpCommandLine(command_line);
70 // Enable <dialog>, which is used in some tests. 72 // Enable <dialog>, which is used in some tests.
71 base::CommandLine::ForCurrentProcess()->AppendSwitch( 73 base::CommandLine::ForCurrentProcess()->AppendSwitch(
72 switches::kEnableExperimentalWebPlatformFeatures); 74 switches::kEnableExperimentalWebPlatformFeatures);
73 } 75 }
74 76
75 void RunAriaTest(const base::FilePath::CharType* file_path) { 77 void RunAriaTest(const base::FilePath::CharType* file_path) {
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 } 1043 }
1042 1044
1043 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityImg) { 1045 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityImg) {
1044 RunHtmlTest(FILE_PATH_LITERAL("img.html")); 1046 RunHtmlTest(FILE_PATH_LITERAL("img.html"));
1045 } 1047 }
1046 1048
1047 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityImgEmptyAlt) { 1049 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityImgEmptyAlt) {
1048 RunHtmlTest(FILE_PATH_LITERAL("img-empty-alt.html")); 1050 RunHtmlTest(FILE_PATH_LITERAL("img-empty-alt.html"));
1049 } 1051 }
1050 1052
1053 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest,
1054 AccessibilityImgLinkEmptyAlt) {
1055 RunHtmlTest(FILE_PATH_LITERAL("img-link-empty-alt.html"));
1056 }
1057
1051 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInPageLinks) { 1058 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInPageLinks) {
1052 RunHtmlTest(FILE_PATH_LITERAL("in-page-links.html")); 1059 RunHtmlTest(FILE_PATH_LITERAL("in-page-links.html"));
1053 } 1060 }
1054 1061
1055 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInputButton) { 1062 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInputButton) {
1056 RunHtmlTest(FILE_PATH_LITERAL("input-button.html")); 1063 RunHtmlTest(FILE_PATH_LITERAL("input-button.html"));
1057 } 1064 }
1058 1065
1059 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 1066 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest,
1060 AccessibilityInputButtonInMenu) { 1067 AccessibilityInputButtonInMenu) {
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 // crbug.com/281952 1495 // crbug.com/281952
1489 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, DISABLED_AccessibilityVideo) { 1496 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, DISABLED_AccessibilityVideo) {
1490 RunHtmlTest(FILE_PATH_LITERAL("video.html")); 1497 RunHtmlTest(FILE_PATH_LITERAL("video.html"));
1491 } 1498 }
1492 1499
1493 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { 1500 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) {
1494 RunHtmlTest(FILE_PATH_LITERAL("wbr.html")); 1501 RunHtmlTest(FILE_PATH_LITERAL("wbr.html"));
1495 } 1502 }
1496 1503
1497 } // namespace content 1504 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_win.cc ('k') | content/renderer/accessibility/blink_ax_enum_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698