1
- DumpAccessibilityTreeTest and DumpAccessibilityEventsTest Notes:
1
+ # DumpAccessibilityTreeTest and DumpAccessibilityEventsTest Notes:
2
2
3
3
Both sets of tests use a similar format for files.
4
4
@@ -28,6 +28,7 @@ ninja -C out/Debug content_browsertests
28
28
out/Debug/content_browsertests --gtest_filter="DumpAccessibility* "
29
29
30
30
Files used:
31
+
31
32
* foo.html -- a file to be tested
32
33
* foo-expected-android.txt -- expected Android AccessibilityNodeInfo output
33
34
* foo-expected-auralinux.txt -- expected Linux ATK output
@@ -36,13 +37,15 @@ Files used:
36
37
* foo-expected-win.txt -- expected Win IAccessible/IAccessible2 output
37
38
38
39
Format for expected files:
40
+
39
41
* Blank lines and lines beginning with # are ignored
40
42
* Skipped files: if first line of file begins with #<skip then the
41
43
test passes. This can be used to indicate desired output with a link
42
44
to a bug, or as a way to temporarily disable a test during refactoring.
43
45
* Use 2 plus signs for indent to show hierarchy
44
46
45
47
Filters:
48
+
46
49
* By default only some attributes of nodes in the accessibility tree, or
47
50
events fired (when running DumpAccessibilityEvents) are output.
48
51
This is to keep the tests robust and not prone to failure when unrelated
@@ -51,11 +54,13 @@ Filters:
51
54
They can appear anywhere but typically they're in an HTML comment block,
52
55
and must be one per line.
53
56
* Filters are platform-specific:
57
+ ```
54
58
@WIN-
55
59
@MAC-
56
60
@BLINK-
57
61
@ANDROID-
58
62
@AURALINUX-
63
+ ```
59
64
* To dump all attributes while writing or debugging a test, add this filter:
60
65
@WIN-ALLOW :*
61
66
(and similarly for other platforms).
@@ -64,16 +69,18 @@ Filters:
64
69
ALLOW filter means to include the attribute, and a DENY filter means to
65
70
exclude it. Filters can contain simple wildcards ('* ') only, they're not
66
71
regular expressions. Examples:
72
+ ```
67
73
- @WIN-ALLOW:name* - this will output the name attribute on Windows
68
74
- @WIN-ALLOW:name='Foo' - this will only output the name attribute if it
69
75
exactly matches 'Foo'.
70
76
- @WIN-DENY:name='X* - this will skip outputting any name that begins with
71
77
the letter X.
78
+ ```
72
79
* By default empty attributes are skipped. To output the value an attribute
73
80
even if it's empty, use @WIN-ALLOW-EMPTY : name , for example, and similarly
74
81
for other platforms.
75
82
76
- Advanced:
83
+ ## Advanced:
77
84
78
85
Normally the system waits for the document to finish loading before dumping
79
86
the accessibility tree.
@@ -98,7 +105,7 @@ To load an iframe from a different site, forcing it into a different process,
98
105
use /cross-site/HOSTNAME/ in the url, for example:
99
106
<iframe src =" cross-site/1.com/accessibility/html/frame.html " ></iframe >
100
107
101
- Generating expectations and rebaselining:
108
+ ## Generating expectations and rebaselining:
102
109
103
110
If you want to populate the expectation file directly rather than typing it
104
111
or copying-and-pasting it, first make sure the file exists (it can be empty),
@@ -113,7 +120,7 @@ This will replace the -expected-*.txt file with the current output. It's
113
120
a great way to rebaseline a bunch of tests after making a change. Please
114
121
manually check the diff, of course!
115
122
116
- Adding a new test:
123
+ ## Adding a new test:
117
124
118
125
If you are adding a new test file remember to add a corresponding test case in
119
126
content/browser/accessibility/dump_accessibility_events_browsertest.cc
0 commit comments