| OLD | NEW |
| 1 DumpAccessibilityTreeTest and DumpAccessibilityEventsTest Notes: | 1 DumpAccessibilityTreeTest and DumpAccessibilityEventsTest Notes: |
| 2 | 2 |
| 3 Both sets of tests use a similar format for files. | 3 Both sets of tests use a similar format for files. |
| 4 | 4 |
| 5 DumpAccessibilityTree tests load an HTML file, wait for it to load, then | 5 DumpAccessibilityTree tests load an HTML file, wait for it to load, then |
| 6 dump the accessibility tree in the "blink" format (the internal data), | 6 dump the accessibility tree in the "blink" format (the internal data), |
| 7 and again in a platform-specific format. | 7 and again in a platform-specific format. |
| 8 | 8 |
| 9 The test output is a compact text representation of the accessibility tree | 9 The test output is a compact text representation of the accessibility tree |
| 10 for that format, and it should be familiar if you're familiar with the | 10 for that format, and it should be familiar if you're familiar with the |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 Normally the system waits for the document to finish loading before dumping | 78 Normally the system waits for the document to finish loading before dumping |
| 79 the accessibility tree. | 79 the accessibility tree. |
| 80 | 80 |
| 81 Occasionally you may need to write a test that makes some changes to the | 81 Occasionally you may need to write a test that makes some changes to the |
| 82 document before it runs the test. In that case you can use a special | 82 document before it runs the test. In that case you can use a special |
| 83 @WAIT-FOR: directive. It should be in an HTML comment, just like | 83 @WAIT-FOR: directive. It should be in an HTML comment, just like |
| 84 @ALLOW-WIN: directives. The WAIT-FOR directive just specifies a text substring | 84 @ALLOW-WIN: directives. The WAIT-FOR directive just specifies a text substring |
| 85 that should be present in the dump when the document is ready. The system | 85 that should be present in the dump when the document is ready. The system |
| 86 will keep blocking until that text appears. | 86 will keep blocking until that text appears. |
| 87 | 87 |
| 88 You can add as many @WAIT-FOR: directives as you want, the test won't finish |
| 89 until all strings appear. |
| 90 |
| 88 To skip dumping a particular element, make its accessible name equal to | 91 To skip dumping a particular element, make its accessible name equal to |
| 89 @NO_DUMP, for example <div aria-label="@NO_DUMP"></div>. | 92 @NO_DUMP, for example <div aria-label="@NO_DUMP"></div>. |
| 90 | 93 |
| 91 To skip dumping all children of a particular element, make its accessible | 94 To skip dumping all children of a particular element, make its accessible |
| 92 name equal to @NO_CHILDREN_DUMP. | 95 name equal to @NO_CHILDREN_DUMP. |
| 93 | 96 |
| 97 To load an iframe from a different site, forcing it into a different process, |
| 98 use @CROSS-SITE: in the url, for example: |
| 99 <iframe src="@CROSS-SITE:iframe.html"></iframe> |
| 100 |
| 94 Generating expectations and rebaselining: | 101 Generating expectations and rebaselining: |
| 95 | 102 |
| 96 If you want to populate the expectation file directly rather than typing it | 103 If you want to populate the expectation file directly rather than typing it |
| 97 or copying-and-pasting it, first make sure the file exists (it can be empty), | 104 or copying-and-pasting it, first make sure the file exists (it can be empty), |
| 98 then run the test with the --generate-accessibility-test-expectations | 105 then run the test with the --generate-accessibility-test-expectations |
| 99 argument, for example: | 106 argument, for example: |
| 100 | 107 |
| 101 out/Debug/content_browsertests \ | 108 out/Debug/content_browsertests \ |
| 102 --generate-accessibility-test-expectations | 109 --generate-accessibility-test-expectations |
| 103 --gtest_filter="DumpAccessibilityTreeTest.AccessibilityA" | 110 --gtest_filter="DumpAccessibilityTreeTest.AccessibilityA" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 123 To write a test for accessibility events, your document must contain a | 130 To write a test for accessibility events, your document must contain a |
| 124 JavaScript function called go(). This function will be called when the document | 131 JavaScript function called go(). This function will be called when the document |
| 125 is loaded (or when the @WAIT_FOR directive passes), and any subsequent | 132 is loaded (or when the @WAIT_FOR directive passes), and any subsequent |
| 126 events will be dumped. Filters apply to events just like in tree dumps. | 133 events will be dumped. Filters apply to events just like in tree dumps. |
| 127 | 134 |
| 128 After calling go(), the system asks the page to generate a sentinel | 135 After calling go(), the system asks the page to generate a sentinel |
| 129 accessibility event - one you're unlikely to generate in your test. It uses | 136 accessibility event - one you're unlikely to generate in your test. It uses |
| 130 that event to know when to "stop" dumping events. There isn't currently a | 137 that event to know when to "stop" dumping events. There isn't currently a |
| 131 way to test events that occur after some delay, just ones that happen as | 138 way to test events that occur after some delay, just ones that happen as |
| 132 a direct result of calling go(). | 139 a direct result of calling go(). |
| OLD | NEW |