| OLD | NEW |
| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // 2. Read the expectation. | 48 // 2. Read the expectation. |
| 49 // 3. Browse to the page and serialize the platform specific tree into a human | 49 // 3. Browse to the page and serialize the platform specific tree into a human |
| 50 // readable string. | 50 // readable string. |
| 51 // 4. Perform a comparison between actual and expected and fail if they do not | 51 // 4. Perform a comparison between actual and expected and fail if they do not |
| 52 // exactly match. | 52 // exactly match. |
| 53 class DumpAccessibilityTreeTest : public DumpAccessibilityTestBase { | 53 class DumpAccessibilityTreeTest : public DumpAccessibilityTestBase { |
| 54 public: | 54 public: |
| 55 void AddDefaultFilters(std::vector<Filter>* filters) override { | 55 void AddDefaultFilters(std::vector<Filter>* filters) override { |
| 56 filters->push_back(Filter(base::ASCIIToUTF16("FOCUSABLE"), Filter::ALLOW)); | 56 filters->push_back(Filter(base::ASCIIToUTF16("FOCUSABLE"), Filter::ALLOW)); |
| 57 filters->push_back(Filter(base::ASCIIToUTF16("READONLY"), Filter::ALLOW)); | 57 filters->push_back(Filter(base::ASCIIToUTF16("READONLY"), Filter::ALLOW)); |
| 58 filters->push_back(Filter(base::ASCIIToUTF16("name*"), Filter::ALLOW)); | 58 filters->push_back(Filter(base::ASCIIToUTF16("name=*"), Filter::ALLOW)); |
| 59 filters->push_back(Filter(base::ASCIIToUTF16("*=''"), Filter::DENY)); | 59 filters->push_back(Filter(base::ASCIIToUTF16("*=''"), Filter::DENY)); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void SetUpCommandLine(base::CommandLine* command_line) override { | 62 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 63 ContentBrowserTest::SetUpCommandLine(command_line); | 63 DumpAccessibilityTestBase::SetUpCommandLine(command_line); |
| 64 // Enable <dialog>, which is used in some tests. | 64 // Enable <dialog>, which is used in some tests. |
| 65 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 65 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 66 switches::kEnableExperimentalWebPlatformFeatures); | 66 switches::kEnableExperimentalWebPlatformFeatures); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void RunAriaTest(const base::FilePath::CharType* file_path) { | 69 void RunAriaTest(const base::FilePath::CharType* file_path) { |
| 70 base::FilePath dir_test_data; | 70 base::FilePath dir_test_data; |
| 71 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); | 71 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); |
| 72 base::FilePath test_path(dir_test_data.AppendASCII("accessibility") | 72 base::FilePath test_path(dir_test_data.AppendASCII("accessibility") |
| 73 .AppendASCII("aria")); | 73 .AppendASCII("aria")); |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 } | 817 } |
| 818 | 818 |
| 819 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityI) { | 819 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityI) { |
| 820 RunHtmlTest(FILE_PATH_LITERAL("i.html")); | 820 RunHtmlTest(FILE_PATH_LITERAL("i.html")); |
| 821 } | 821 } |
| 822 | 822 |
| 823 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityIframe) { | 823 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityIframe) { |
| 824 RunHtmlTest(FILE_PATH_LITERAL("iframe.html")); | 824 RunHtmlTest(FILE_PATH_LITERAL("iframe.html")); |
| 825 } | 825 } |
| 826 | 826 |
| 827 // Flaky. See http://crbug.com/224659. | |
| 828 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, | 827 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, |
| 829 DISABLED_AccessibilityIframeCoordinates) { | 828 AccessibilityIframeCrossProcess) { |
| 829 RunHtmlTest(FILE_PATH_LITERAL("iframe-cross-process.html")); |
| 830 } |
| 831 |
| 832 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, |
| 833 AccessibilityIframeCoordinates) { |
| 830 RunHtmlTest(FILE_PATH_LITERAL("iframe-coordinates.html")); | 834 RunHtmlTest(FILE_PATH_LITERAL("iframe-coordinates.html")); |
| 831 } | 835 } |
| 832 | 836 |
| 833 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, | 837 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, |
| 838 AccessibilityIframeCoordinatesCrossProcess) { |
| 839 RunHtmlTest(FILE_PATH_LITERAL("iframe-coordinates-cross-process.html")); |
| 840 } |
| 841 |
| 842 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, |
| 834 AccessibilityIframePresentational) { | 843 AccessibilityIframePresentational) { |
| 835 RunHtmlTest(FILE_PATH_LITERAL("iframe-presentational.html")); | 844 RunHtmlTest(FILE_PATH_LITERAL("iframe-presentational.html")); |
| 836 } | 845 } |
| 837 | 846 |
| 838 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityImg) { | 847 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityImg) { |
| 839 RunHtmlTest(FILE_PATH_LITERAL("img.html")); | 848 RunHtmlTest(FILE_PATH_LITERAL("img.html")); |
| 840 } | 849 } |
| 841 | 850 |
| 842 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInputButton) { | 851 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInputButton) { |
| 843 RunHtmlTest(FILE_PATH_LITERAL("input-button.html")); | 852 RunHtmlTest(FILE_PATH_LITERAL("input-button.html")); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 // crbug.com/281952 | 1261 // crbug.com/281952 |
| 1253 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, DISABLED_AccessibilityVideo) { | 1262 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, DISABLED_AccessibilityVideo) { |
| 1254 RunHtmlTest(FILE_PATH_LITERAL("video.html")); | 1263 RunHtmlTest(FILE_PATH_LITERAL("video.html")); |
| 1255 } | 1264 } |
| 1256 | 1265 |
| 1257 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { | 1266 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { |
| 1258 RunHtmlTest(FILE_PATH_LITERAL("wbr.html")); | 1267 RunHtmlTest(FILE_PATH_LITERAL("wbr.html")); |
| 1259 } | 1268 } |
| 1260 | 1269 |
| 1261 } // namespace content | 1270 } // namespace content |
| OLD | NEW |