OLD | NEW |
(Empty) | |
| 1 # Accessibility |
| 2 |
| 3 Here's a quick overview of all of the locations in the codebase where |
| 4 you'll find accessibility tests, and a brief overview of the purpose of |
| 5 all of them. |
| 6 |
| 7 ## Layout Tests |
| 8 |
| 9 This is the primary place where we test accessibility code in Blink. This |
| 10 code should have no platform-specific code. Use this to test anything |
| 11 where there's any interesting web platform logic, or where you need to be |
| 12 able to query things synchronously from the renderer thread to test them. |
| 13 |
| 14 Don't add tests for trivial features like ARIA attributes that we just |
| 15 expose directly to the next layer up. In those cases the Blink tests are |
| 16 trivial and it's more valuable to test these features at a higher level |
| 17 where we can ensure they actually work. |
| 18 |
| 19 Note that many of these tests are inherited from WebKit and the coding style |
| 20 has evolved a lot since then. Look for more recent tests as a guide if writing |
| 21 a new one. |
| 22 |
| 23 Test files: |
| 24 ``` |
| 25 third_party/WebKit/LayoutTests/accessibility |
| 26 ``` |
| 27 |
| 28 Source code to AccessibilityController and WebAXObjectProxy: |
| 29 ``` |
| 30 content/shell/test_runner |
| 31 ``` |
| 32 |
| 33 To run all accessibility LayoutTests: |
| 34 ``` |
| 35 ninja -C out/release blink_tests |
| 36 third_party/WebKit/Tools/Scripts/run-webkit-tests --build-directory=out --target
=release accessibility/ |
| 37 ``` |
| 38 |
| 39 To run just one test by itself without the script: |
| 40 ``` |
| 41 ninja -C out/release blink_tests |
| 42 out/release/content_shell --run-layout-test third_party/WebKit/LayoutTests/acces
sibility/name-calc-inputs.html |
| 43 ``` |
| 44 |
| 45 ## DumpAccessibilityTree tests |
| 46 |
| 47 This is the best way to write both cross-platform and platform-specific tests |
| 48 using only an input HTML file, some magic strings to describe what attributes |
| 49 you're interested in, and one or more expectation files to enable checking |
| 50 whether the resulting accessibility tree is correct or not. In particular, |
| 51 almost no test code is required. |
| 52 |
| 53 [More documentation on DumpAccessibilityTree](../../content/test/data/accessibil
ity/readme.md) |
| 54 |
| 55 Test files: |
| 56 ``` |
| 57 content/test/data/accessibility |
| 58 ``` |
| 59 |
| 60 Test runner: |
| 61 ``` |
| 62 content/browser/accessibility/dump_accessibility_tree_browsertest.cc |
| 63 ``` |
| 64 |
| 65 To run all tests: |
| 66 ``` |
| 67 ninja -C out/release content_browsertests |
| 68 out/release/content_browsertests --gtest_filter="DumpAccessibilityTree*" |
| 69 ``` |
| 70 |
| 71 ## Other content_browsertests |
| 72 |
| 73 There are many other tests in content/ that relate to accessibility. |
| 74 All of these tests work by launching a full multi-process browser shell, |
| 75 loading a web page in a renderer, then accessing the resulting accessibility |
| 76 tree from the browser process, and running some test from there. |
| 77 |
| 78 To run all tests: |
| 79 ``` |
| 80 ninja -C out/release content_browsertests |
| 81 out/release/content_browsertests --gtest_filter="*ccessib*" |
| 82 ``` |
| 83 |
| 84 ## Accessibility unittests |
| 85 |
| 86 This tests the core accessibility code that's shared by both web and non-web |
| 87 accessibility infrastructure. |
| 88 |
| 89 Code location: |
| 90 ``` |
| 91 ui/accessibility |
| 92 ``` |
| 93 |
| 94 To run all tests: |
| 95 ``` |
| 96 ninja -C out/release accessibility_unittests |
| 97 out/release/accessibility_unittests |
| 98 ``` |
| 99 |
| 100 ## ChromeVox tests |
| 101 |
| 102 You must build with ```target_os = "chromeos"``` in your GN args. |
| 103 |
| 104 To run all tests: |
| 105 ``` |
| 106 ninja -C out/release chromevox_tests |
| 107 out/release/chromevox_tests --test-launcher-jobs=10 |
| 108 ``` |
| 109 |
| 110 ## Other locations of accessibility tests: |
| 111 |
| 112 Even this isn't a complete list. The tests described above cover more |
| 113 than 90% of the accessibility tests, and the remainder are scattered |
| 114 throughout the codebase. Here are a few other locations to check: |
| 115 |
| 116 ``` |
| 117 chrome/android/javatests/src/org/chromium/chrome/browser/accessibility |
| 118 chrome/browser/accessibility |
| 119 chrome/browser/chromeos/accessibility/ |
| 120 ui/chromeos |
| 121 ui/views/accessibility |
| 122 ``` |
| 123 |
OLD | NEW |