| 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/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 const char kSignalDiff[] = "*"; | 47 const char kSignalDiff[] = "*"; |
| 48 | 48 |
| 49 } // namespace | 49 } // namespace |
| 50 | 50 |
| 51 typedef AccessibilityTreeFormatter::Filter Filter; | 51 typedef AccessibilityTreeFormatter::Filter Filter; |
| 52 | 52 |
| 53 // This test takes a snapshot of the platform BrowserAccessibility tree and | 53 // This test takes a snapshot of the platform BrowserAccessibility tree and |
| 54 // tests it against an expected baseline. | 54 // tests it against an expected baseline. |
| 55 // | 55 // |
| 56 // The flow of the test is as outlined below. | 56 // The flow of the test is as outlined below. |
| 57 // 1. Load an html file from chrome/test/data/accessibility. | 57 // 1. Load an html file from content/test/data/accessibility. |
| 58 // 2. Read the expectation. | 58 // 2. Read the expectation. |
| 59 // 3. Browse to the page and serialize the platform specific tree into a human | 59 // 3. Browse to the page and serialize the platform specific tree into a human |
| 60 // readable string. | 60 // readable string. |
| 61 // 4. Perform a comparison between actual and expected and fail if they do not | 61 // 4. Perform a comparison between actual and expected and fail if they do not |
| 62 // exactly match. | 62 // exactly match. |
| 63 class DumpAccessibilityTreeTest : public ContentBrowserTest { | 63 class DumpAccessibilityTreeTest : public ContentBrowserTest { |
| 64 public: | 64 public: |
| 65 // Utility helper that does a comment aware equality check. | 65 // Utility helper that does a comment aware equality check. |
| 66 // Returns array of lines from expected file which are different. | 66 // Returns array of lines from expected file which are different. |
| 67 std::vector<int> DiffLines(const std::vector<std::string>& expected_lines, | 67 std::vector<int> DiffLines(const std::vector<std::string>& expected_lines, |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 | 860 |
| 861 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityUl) { | 861 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityUl) { |
| 862 RunTest(FILE_PATH_LITERAL("ul.html")); | 862 RunTest(FILE_PATH_LITERAL("ul.html")); |
| 863 } | 863 } |
| 864 | 864 |
| 865 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { | 865 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { |
| 866 RunTest(FILE_PATH_LITERAL("wbr.html")); | 866 RunTest(FILE_PATH_LITERAL("wbr.html")); |
| 867 } | 867 } |
| 868 | 868 |
| 869 } // namespace content | 869 } // namespace content |
| OLD | NEW |