diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2020-03-06 15:05:50 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2020-03-08 16:17:20 +0100 |
commit | d183801ba254abb859fe5aeb59f3ca05fc5d2a20 (patch) | |
tree | c75a072f088379e5e10e89c8994b470fff638ec8 /tests | |
parent | 79f25342cb70fc387453a946174b937c182ece8d (diff) |
Update accessibility roles and test after 79-based
Change-Id: I23bd548db07c6332170e9d304977e5974c7f049f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/accessibility/tst_accessibility.cpp | 307 |
1 files changed, 183 insertions, 124 deletions
diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp index 98f15e684..9ec9e6a5b 100644 --- a/tests/auto/widgets/accessibility/tst_accessibility.cpp +++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp @@ -336,130 +336,189 @@ void tst_Accessibility::roles_data() QTest::addColumn<int>("nested"); QTest::addColumn<QAccessible::Role>("role"); - QTest::newRow("AX_ROLE_ABBR") << QString("<abbr>a</abbr>") << 1 << QAccessible::StaticText; - QTest::newRow("AX_ROLE_ALERT") << QString("<div role='alert'>alert</div>") << 0 << QAccessible::AlertMessage; - QTest::newRow("AX_ROLE_ALERT_DIALOG") << QString("<div role='alertdialog'>alert</div>") << 0 << QAccessible::AlertMessage; - QTest::newRow("AX_ROLE_ANCHOR") << QString("<a id='a'>Chapter a</a>") << 1 << QAccessible::Link; - QTest::newRow("AX_ROLE_ANNOTATION") << QString("<rt>a</rt>") << 1 << QAccessible::StaticText; - QTest::newRow("AX_ROLE_APPLICATION") << QString("<div role='application'>landmark</div>") << 0 << QAccessible::Document; - QTest::newRow("AX_ROLE_ARTICLE") << QString("<article>a</article>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_AUDIO") << QString("<audio controls><source src='test.mp3' type='audio/mpeg'></audio>") << 1 << QAccessible::Sound; - QTest::newRow("AX_ROLE_BANNER") << QString("<div role=banner>a</div>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_BLOCKQUOTE") << QString("<blockquote>a</blockquote>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_BUTTON") << QString("<button>a</button>") << 1 << QAccessible::Button; - //QTest::newRow("AX_ROLE_BUTTON_DROP_DOWN"); // TODO: Remove this during the next Chromium update: https://chromium-review.googlesource.com/842475 - //QTest::newRow("AX_ROLE_CANVAS") << QString("<canvas width='10' height='10'></canvas>") << 0 << QAccessible::Canvas; // FIXME: The test case might be wrong (see AXLayoutObject.cpp) - QTest::newRow("AX_ROLE_CAPTION") << QString("<table><caption>a</caption></table>") << 1 << QAccessible::Heading; - //QTest::newRow("AX_ROLE_CARET"); // Not a blink accessibility role - QTest::newRow("AX_ROLE_CELL") << QString("<table role=table><tr><td>a</td></tr></table>") << 2 << QAccessible::Cell; - QTest::newRow("AX_ROLE_CHECK_BOX") << QString("<input type='checkbox'>a</input>") << 1 << QAccessible::CheckBox; - QTest::newRow("AX_ROLE_CLIENT") << QString("") << 0 << QAccessible::Client; - QTest::newRow("AX_ROLE_COLOR_WELL") << QString("<input type='color'>a</input>") << 1 << QAccessible::ColorChooser; - //QTest::newRow("AX_ROLE_COLUMN") << QString("<table><tr><td>a</td></tr>") << 0 << QAccessible::Column; // FIXME: The test case might be wrong (see AXTableColumn.h) - QTest::newRow("AX_ROLE_COLUMN_HEADER") << QString("<table role=table><tr><th>a</th></tr><tr><td>a</td></tr></table>") << 2 << QAccessible::ColumnHeader; - QTest::newRow("AX_ROLE_COMBO_BOX_GROUPING") << QString("<div role='combobox'><input></div>") << 0 << QAccessible::ComboBox; - QTest::newRow("AX_ROLE_COMBO_BOX_MENU_BUTTON") << QString("<div tabindex=0 role='combobox'>Select</div>") << 0 << QAccessible::ComboBox; - QTest::newRow("AX_ROLE_TEXT_FIELD_WITH_COMBO_BOX") << QString("<input role='combobox'>") << 1 << QAccessible::ComboBox; - QTest::newRow("AX_ROLE_COMPLEMENTARY") << QString("<aside>a</aside>") << 0 << QAccessible::ComplementaryContent; - QTest::newRow("AX_ROLE_CONTENT_INFO") << QString("<address>a</address>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_DATE") << QString("<input type='date'></input>") << 1 << QAccessible::Clock; - QTest::newRow("AX_ROLE_DATE_TIME") << QString("<input type='datetime-local'></input>") << 1 << QAccessible::Clock; - QTest::newRow("AX_ROLE_DEFINITION") << QString("<div role='definition'>landmark</div>") << 0 << QAccessible::Paragraph; - QTest::newRow("AX_ROLE_DESCRIPTION_LIST") << QString("<dl>a</dl>") << 0 << QAccessible::List; - QTest::newRow("AX_ROLE_DESCRIPTION_LIST_DETAIL") << QString("<dd>a</dd>") << 0 << QAccessible::Paragraph; - QTest::newRow("AX_ROLE_DESCRIPTION_LIST_TERM") << QString("<dt>a</dt>") << 0 << QAccessible::ListItem; - QTest::newRow("AX_ROLE_DETAILS") << QString("<details>a</details>") << 0 << QAccessible::Grouping; - //QTest::newRow("AX_ROLE_DESKTOP"); // Not a blink accessibility role - QTest::newRow("AX_ROLE_DIALOG") << QString("<div role='dialog'></div>") << 0 << QAccessible::Dialog; - //QTest::newRow("AX_ROLE_DIRECTORY") << QString("<div role='directory'></div>") << 0 << QAccessible::NoRole; // FIXME: Aria role 'directory' should work - QTest::newRow("AX_ROLE_DISCLOSURE_TRIANGLE") << QString("<details><summary>a</summary></details>") << 1 << QAccessible::NoRole; - QTest::newRow("AX_ROLE_GENERIC_CONTAINER") << QString("<div>a</div>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_DOCUMENT") << QString("<div role='document'>a</div>") << 0 << QAccessible::Document; - QTest::newRow("AX_ROLE_EMBEDDED_OBJECT") << QString("<object width='10' height='10'></object>") << 1 << QAccessible::Grouping; - QTest::newRow("AX_ROLE_FEED") << QString("<div role='feed'>a</div>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_FIGCAPTION") << QString("<figcaption>a</figcaption>") << 0 << QAccessible::Heading; - QTest::newRow("AX_ROLE_FIGURE") << QString("<figure>a</figure>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_FOOTER") << QString("<footer>a</footer>") << 0 << QAccessible::Footer; - QTest::newRow("AX_ROLE_FORM") << QString("<form></form>") << 0 << QAccessible::Form; - QTest::newRow("AX_ROLE_GRID") << QString("<div role='grid'></div>") << 0 << QAccessible::Table; - QTest::newRow("AX_ROLE_GROUP") << QString("<fieldset></fieldset>") << 0 << QAccessible::Grouping; - QTest::newRow("AX_ROLE_HEADER)") << QString("<header>a</header>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_HEADING") << QString("<h1>a</h1>") << 0 << QAccessible::Heading; - QTest::newRow("AX_ROLE_IFRAME") << QString("<iframe>a</iframe>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_IFRAME_PRESENTATIONAL") << QString("<iframe role='presentation'>a</iframe>") << 1 << QAccessible::NoRole; - //QTest::newRow("AX_ROLE_IGNORED") << QString("<tag>a</tag>") << 0 << QAccessible::NoRole; // FIXME: The HTML element should not be exposed as an element (see AXNodeObject.cpp) - QTest::newRow("AX_ROLE_IMAGE") << QString("<img>") << 1 << QAccessible::Graphic; - //QTest::newRow("AX_ROLE_IMAGE_MAP") << QString("<map>a</map>") << 0 << QAccessible::Graphic; // FIXME: The test case might be wrong (see AXLayoutObject.cpp) - QTest::newRow("AX_ROLE_INLINE_TEXT_BOX") << QString("<textarea rows='4' cols='50'></textarea>") << 1 << QAccessible::EditableText; - QTest::newRow("AX_ROLE_INPUT_TIME") << QString("<input type='time'></input>") << 1 << QAccessible::SpinBox; - QTest::newRow("AX_ROLE_LABEL_TEXT") << QString("<label>a</label>") << 1 << QAccessible::StaticText; - QTest::newRow("AX_ROLE_LEGEND") << QString("<legend>a</legend>") << 0 << QAccessible::StaticText; - QTest::newRow("AX_ROLE_LINE_BREAK") << QString("<br>") << 1 << QAccessible::Separator; - QTest::newRow("AX_ROLE_LINK") << QString("<a href=''>link</a>") << 1 << QAccessible::Link; - QTest::newRow("AX_ROLE_LIST") << QString("<ul></ul>") << 0 << QAccessible::List; - QTest::newRow("AX_ROLE_LIST_BOX") << QString("<select multiple></select>") << 1 << QAccessible::ComboBox; - QTest::newRow("AX_ROLE_LIST_BOX_OPTION") << QString("<option>a</option>") << 0 << QAccessible::ListItem; - QTest::newRow("AX_ROLE_LIST_ITEM") << QString("<li>a</li>") << 0 << QAccessible::ListItem; - QTest::newRow("AX_ROLE_LIST_MARKER") << QString("<li><ul></ul></li>") << 1 << QAccessible::StaticText; - //QTest::newRow("AX_ROLE_LOCATION_BAR"); // Not a blink accessibility role - QTest::newRow("AX_ROLE_LOG") << QString("<div role='log'>a</div>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_MAIN") << QString("<main>a</main>") << 0 << QAccessible::Grouping; - QTest::newRow("AX_ROLE_MARK") << QString("<mark>a</mark>") << 1 << QAccessible::StaticText; - QTest::newRow("AX_ROLE_MARQUEE") << QString("<div role='marquee'>a</div>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_MATH") << QString("<math>a</math>") << 1 << QAccessible::Equation; - QTest::newRow("AX_ROLE_MENU") << QString("<div role='menu'>a</div>") << 0 << QAccessible::PopupMenu; - QTest::newRow("AX_ROLE_MENU_BAR") << QString("<div role='menubar'>a</div>") << 0 << QAccessible::MenuBar; - QTest::newRow("AX_ROLE_MENU_ITEM") << QString("<menu role='menu'><input type='button' /></menu>") << 1 << QAccessible::MenuItem; - QTest::newRow("AX_ROLE_MENU_ITEM_CHECK_BOX") << QString("<menu role='menu'><input type='checkbox'></input></menu>") << 1 << QAccessible::CheckBox; - QTest::newRow("AX_ROLE_MENU_ITEM_RADIO") << QString("<menu role='menu'><input type='radio'></input></menu>") << 1 << QAccessible::RadioButton; - QTest::newRow("AX_ROLE_MENU_BUTTON") << QString("<menu role='group'><div role='menuitem'>a</div></menu>") << 1 << QAccessible::MenuItem; - //QTest::newRow("AX_ROLE_MENU_LIST_OPTION") << QString("<select role='menu'><option>a</option></select>") << false << QAccessible::MenuItem; // FIXME: <select> should be a menu list (see AXMenuListOption.cpp) - //QTest::newRow("AX_ROLE_MENU_LIST_POPUP") << QString("<menu type='context'>a</menu>") << 0 << QAccessible::PopupMenu; // FIXME: <menu> is not fully supported by Chromium (see AXMenuListPopup.h) - QTest::newRow("AX_ROLE_METER") << QString("<meter>a</meter>") << 1 << QAccessible::Chart; - QTest::newRow("AX_ROLE_NAVIGATION") << QString("<nav>a</nav>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_NOTE") << QString("<div role='note'>a</div>") << 0 << QAccessible::Note; - //QTest::newRow("AX_ROLE_PANE"); // Not a blink accessibility role - QTest::newRow("AX_ROLE_PARAGRAH") << QString("<p>a</p>") << 0 << QAccessible::Paragraph; - QTest::newRow("AX_ROLE_POP_UP_BUTTON") << QString("<select><option>a</option></select>") << 1 << QAccessible::ComboBox; - QTest::newRow("AX_ROLE_PRE") << QString("<pre>a</pre>") << 0 << QAccessible::Section; - //QTest::newRow("AX_ROLE_PRESENTATIONAL") << QString("<div role='presentation'>a</div>") << 0 << QAccessible::NoRole; // FIXME: Aria role 'presentation' should work - QTest::newRow("AX_ROLE_PROGRESS_INDICATOR") << QString("<div role='progressbar' aria-valuenow='77' aria-valuemin='22' aria-valuemax='99'></div>") << 0 << QAccessible::ProgressBar; - QTest::newRow("AX_ROLE_RADIO_BUTTON") << QString("<input type='radio'></input>") << 1 << QAccessible::RadioButton; - QTest::newRow("AX_ROLE_RADIO_GROUP") << QString("<fieldset role='radiogroup'></fieldset>") << 0 << QAccessible::Grouping; - QTest::newRow("AX_ROLE_REGION") << QString("<section>a</section>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_ROW") << QString("<table role=table><tr><td>a</td></tr></table>") << 1 << QAccessible::Row; - QTest::newRow("AX_ROLE_ROW_HEADER") << QString("<table role=table><tr><th>a</td><td>b</td></tr></table>") << 2 << QAccessible::RowHeader; - QTest::newRow("AX_ROLE_RUBY") << QString("<ruby>a</ruby>") << 1 << QAccessible::StaticText; - QTest::newRow("AX_ROLE_SCROLL_BAR") << QString("<div role='scrollbar'>a</a>") << 0 << QAccessible::ScrollBar; - QTest::newRow("AX_ROLE_SEARCH") << QString("<div role='search'>landmark</div>") << 0 << QAccessible::Section; - QTest::newRow("AX_ROLE_SEARCH_BOX") << QString("<input type='search'></input>") << 1 << QAccessible::EditableText; - QTest::newRow("AX_ROLE_SLIDER") << QString("<input type='range'></input>") << 1 << QAccessible::Slider; - //QTest::newRow("AX_ROLE_SLIDER_THUMB"); // No mapping to ARIA role - QTest::newRow("AX_ROLE_SPIN_BUTTON") << QString("<input type='number'></input>") << 1 << QAccessible::SpinBox; - //QTest::newRow("AX_ROLE_SPIN_BUTTON_PART"); // No mapping to ARIA role - QTest::newRow("AX_ROLE_SPLITER") << QString("<hr>") << 0 << QAccessible::Splitter; - QTest::newRow("AX_ROLE_STATIC_TEXT") << QString("a") << 1 << QAccessible::StaticText; - QTest::newRow("AX_ROLE_STATUS") << QString("<output>a</output>") << 1 << QAccessible::Indicator; - QTest::newRow("AX_ROLE_SVG_ROOT") << QString("<svg width='10' height='10'></svg>") << 1 << QAccessible::Graphic; - QTest::newRow("AX_ROLE_SWITCH") << QString("<button aria-checked='false'>a</button>") << 1 << QAccessible::Button; - QTest::newRow("AX_ROLE_TABLE") << QString("<table role=table><td>a</td></table>") << 0 << QAccessible::Table; - //QTest::newRow("AX_ROLE_TABLE_HEADER_CONTAINER"); // No mapping to ARIA role - QTest::newRow("AX_ROLE_TAB") << QString("<div role='tab'>a</div>") << 0 << QAccessible::PageTab; - QTest::newRow("AX_ROLE_TAB_LIST") << QString("<div role='tablist'>a</div>") << 0 << QAccessible::PageTabList; - QTest::newRow("AX_ROLE_TAB_PANEL") << QString("<div role='tabpanel'>a</div>") << 0 << QAccessible::Pane; - QTest::newRow("AX_ROLE_TERM") << QString("<div role='term'>a</div>") << 0 << QAccessible::StaticText; - QTest::newRow("AX_ROLE_TEXT_FIELD") << QString("<input type='text'></input>") << 1 << QAccessible::EditableText; - QTest::newRow("AX_ROLE_TIME") << QString("<time>a</time>") << 1 << QAccessible::Clock; - QTest::newRow("AX_ROLE_TIMER") << QString("<div role='timer'>a</div>") << 0 << QAccessible::Clock; - //QTest::newRow("AX_ROLE_TITLE_BAR"); // Not a blink accessibility role - QTest::newRow("AX_ROLE_TOGGLE_BUTTON") << QString("<button aria-pressed='false'>a</button>") << 1 << QAccessible::Button; - QTest::newRow("AX_ROLE_TOOLBAR") << QString("<div role='toolbar'>a</div>") << 0 << QAccessible::ToolBar; - QTest::newRow("AX_ROLE_TOOLTIP") << QString("<div role='tooltip'>a</div>") << 0 << QAccessible::ToolTip; - QTest::newRow("AX_ROLE_TREE") << QString("<div role='tree'>a</div>") << 0 << QAccessible::Tree; - QTest::newRow("AX_ROLE_TREE_GRID") << QString("<div role='treegrid'>a</div>") << 0 << QAccessible::Tree; - QTest::newRow("AX_ROLE_TREE_ITEM") << QString("<div role='treeitem'>a</div>") << 0 << QAccessible::TreeItem; - QTest::newRow("AX_ROLE_VIDEO") << QString("<video><source src='test.mp4' type='video/mp4'></video>") << 1 << QAccessible::Animation; - //QTest::newRow("AX_ROLE_WINDOW"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kAbbr") << QString("<abbr>a</abbr>") << 1 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::KAlert") << QString("<div role='alert'>alert</div>") << 0 << QAccessible::AlertMessage; + QTest::newRow("ax::mojom::Role::kAlertDialog") << QString("<div role='alertdialog'>alert</div>") << 0 << QAccessible::AlertMessage; + QTest::newRow("ax::mojom::Role::kAnchor") << QString("<a id='a'>Chapter a</a>") << 1 << QAccessible::Link; + + // REMINDER: annotation roles are removed from Chromium 80: https://chromium-review.googlesource.com/c/chromium/src/+/1907074 + //QTest::newRow("ax::mojom::Role::kAnnotationAttribution") << QString("<div role='annotation-attribution'></div>") << 0 << QAccessible::Section; // FIXME: Aria role 'annotation-attribution' should work + //QTest::newRow("ax::mojom::Role::kAnnotationCommentary") << QString("<div role='annotation-commentary'></div>") << 0 << QAccessible::Section; // FIXME: Aria role 'annotation-commentary' should work + //QTest::newRow("ax::mojom::Role::kAnnotationPresence") << QString("<div role='annotation-presence'></div>") << 0 << QAccessible::Section; // FIXME: Aria role 'annotation-presence' should work + //QTest::newRow("ax::mojom::Role::kAnnotationRevision") << QString("<div role='annotation-revision'></div>") << 0 << QAccessible::Section; // FIXME: Aria role 'annotation-revision' should work + //QTest::newRow("ax::mojom::Role::kAnnotationSuggestion") << QString("<div role='annotation-suggestion'></div>") << 0 << QAccessible::Section; // FIXME: Aria role 'annotation-suggestion' should work + + QTest::newRow("ax::mojom::Role::kApplication") << QString("<div role='application'>landmark</div>") << 0 << QAccessible::Document; + QTest::newRow("ax::mojom::Role::kArticle") << QString("<article>a</article>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kAudio") << QString("<audio controls><source src='test.mp3' type='audio/mpeg'></audio>") << 1 << QAccessible::Sound; + QTest::newRow("ax::mojom::Role::kBanner") << QString("<div role='banner'>a</div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kBlockquote") << QString("<blockquote>a</blockquote>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kButton") << QString("<button>a</button>") << 1 << QAccessible::Button; + //QTest::newRow("ax::mojom::Role::kCanvas") << QString("<canvas width='10' height='10'></canvas>") << 0 << QAccessible::Canvas; // FIXME: The test case might be wrong (see AXLayoutObject.cpp) + QTest::newRow("ax::mojom::Role::kCaption") << QString("<table><caption>a</caption></table>") << 1 << QAccessible::Heading; + //QTest::newRow("ax::mojom::Role::kCaret"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kCell") << QString("<table role=table><tr><td>a</td></tr></table>") << 2 << QAccessible::Cell; + QTest::newRow("ax::mojom::Role::kCheckBox") << QString("<input type='checkbox'>a</input>") << 1 << QAccessible::CheckBox; + QTest::newRow("ax::mojom::Role::kClient") << QString("") << 0 << QAccessible::Client; + QTest::newRow("ax::mojom::Role::kColorWell") << QString("<input type='color'>a</input>") << 1 << QAccessible::ColorChooser; + //QTest::newRow("ax::mojom::Role::kColumn") << QString("<table><tr><td>a</td></tr></table>") << 0 << QAccessible::Column; // FIXME: The test case might be wrong (see AXTableColumn.h) + QTest::newRow("ax::mojom::Role::kColumnHeader") << QString("<table role=table><tr><th>a</th></tr><tr><td>a</td></tr></table>") << 2 << QAccessible::ColumnHeader; + QTest::newRow("ax::mojom::Role::kComboBoxGrouping") << QString("<div role='combobox'><input></div>") << 0 << QAccessible::ComboBox; + QTest::newRow("ax::mojom::Role::kComboBoxMenuButton") << QString("<div tabindex=0 role='combobox'>Select</div>") << 0 << QAccessible::ComboBox; + QTest::newRow("ax::mojom::Role::kTextFieldWithComboBox") << QString("<input role='combobox'>") << 1 << QAccessible::ComboBox; + QTest::newRow("ax::mojom::Role::kComplementary") << QString("<aside>a</aside>") << 0 << QAccessible::ComplementaryContent; + QTest::newRow("ax::mojom::Role::kContentDeletion") << QString("<div role='deletion'></div>") << 0 << QAccessible::Grouping; + QTest::newRow("ax::mojom::Role::kContentInsertion") << QString("<div role='insertion'></div>") << 0 << QAccessible::Grouping; + QTest::newRow("ax::mojom::Role::kContentInfo") << QString("<div role='contentinfo'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kData") << QString("<input type='date'></input>") << 1 << QAccessible::Clock; + QTest::newRow("ax::mojom::Role::kDateTime") << QString("<input type='datetime-local'></input>") << 1 << QAccessible::Clock; + QTest::newRow("ax::mojom::Role::kDefinition") << QString("<div role='definition'>landmark</div>") << 0 << QAccessible::Paragraph; + QTest::newRow("ax::mojom::Role::kDescriptionList") << QString("<dl>a</dl>") << 0 << QAccessible::List; + QTest::newRow("ax::mojom::Role::kDescriptionListDetail") << QString("<dd>a</dd>") << 0 << QAccessible::Paragraph; + QTest::newRow("ax::mojom::Role::kDescriptionListTerm") << QString("<dt>a</dt>") << 0 << QAccessible::ListItem; + QTest::newRow("ax::mojom::Role::kDetails") << QString("<details>a</details>") << 0 << QAccessible::Grouping; + //QTest::newRow("ax::mojom::Role::kDesktop"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kDialog") << QString("<div role='dialog'></div>") << 0 << QAccessible::Dialog; + //QTest::newRow("ax::mojom::Role::kDirectory") << QString("<ul role='directory'></ul>") << 0 << QAccessible::List; // FIXME: Aria role 'directory' should work + QTest::newRow("ax::mojom::Role::kDisclosureTriangle") << QString("<details><summary>a</summary></details>") << 1 << QAccessible::Button; + QTest::newRow("ax::mojom::Role::kGenericContainer") << QString("<div>a</div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocCover") << QString("<div role='doc-cover'></div>") << 0 << QAccessible::Graphic; + QTest::newRow("ax::mojom::Role::kDocBackLink") << QString("<div role='doc-backlink'></div>") << 0 << QAccessible::Link; + QTest::newRow("ax::mojom::Role::kDocBiblioRef") << QString("<div role='doc-biblioref'></div>") << 0 << QAccessible::Link; + QTest::newRow("ax::mojom::Role::kDocGlossRef") << QString("<div role='doc-glossref'></div>") << 0 << QAccessible::Link; + QTest::newRow("ax::mojom::Role::kDocNoteRef") << QString("<div role='doc-noteref'></div>") << 0 << QAccessible::Link; + QTest::newRow("ax::mojom::Role::kDocBiblioEntry") << QString("<div role='doc-biblioentry'></div>") << 0 << QAccessible::ListItem; + QTest::newRow("ax::mojom::Role::kDocEndnote") << QString("<div role='doc-endnote'></div>") << 0 << QAccessible::ListItem; + QTest::newRow("ax::mojom::Role::kDocFootnote") << QString("<div role='doc-footnote'></div>") << 0 << QAccessible::ListItem; + QTest::newRow("ax::mojom::Role::kDocPageBreak") << QString("<div role='doc-pagebreak'></div>") << 0 << QAccessible::Separator; + QTest::newRow("ax::mojom::Role::kDocAbstract") << QString("<div role='doc-abstract'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocAcknowledgements") << QString("<div role='doc-acknowledgments'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocAfterword") << QString("<div role='doc-afterword'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocAppendix") << QString("<div role='doc-appendix'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocBibliography") << QString("<div role='doc-bibliography'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocChapter") << QString("<div role='doc-chapter'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocColophon") << QString("<div role='doc-colophon'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocConclusion") << QString("<div role='doc-conclusion'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocCredit") << QString("<div role='doc-credit'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocCredits") << QString("<div role='doc-credits'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocDedication") << QString("<div role='doc-dedication'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocEndnotes") << QString("<div role='doc-endnotes'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocEpigraph") << QString("<div role='doc-epigraph'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocEpilogue") << QString("<div role='doc-epilogue'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocErrata") << QString("<div role='doc-errata'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocExample") << QString("<div role='doc-example'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocForeword") << QString("<div role='doc-foreword'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocGlossary") << QString("<div role='doc-glossary'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocIndex") << QString("<div role='doc-index'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocIntroduction") << QString("<div role='doc-introduction'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocNotice") << QString("<div role='doc-notice'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocPageList") << QString("<div role='doc-pagelist'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocPart") << QString("<div role='doc-part'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocPreface") << QString("<div role='doc-preface'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocPrologue") << QString("<div role='doc-prologue'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocPullquote") << QString("<div role='doc-pullquote'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocQna") << QString("<div role='doc-qna'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocSubtitle") << QString("<div role='doc-subtitle'></div>") << 0 << QAccessible::Heading; + QTest::newRow("ax::mojom::Role::kDocTip") << QString("<div role='doc-tip'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocToc") << QString("<div role='doc-toc'></div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kDocument") << QString("<div role='document'>a</div>") << 0 << QAccessible::Document; + QTest::newRow("ax::mojom::Role::kEmbeddedObject") << QString("<object width='10' height='10'></object>") << 1 << QAccessible::Grouping; + QTest::newRow("ax::mojom::Role::kFeed") << QString("<div role='feed'>a</div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kFigcaption") << QString("<figcaption>a</figcaption>") << 0 << QAccessible::Heading; + QTest::newRow("ax::mojom::Role::kFigure") << QString("<figure>a</figure>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kFooter") << QString("<footer>a</footer>") << 0 << QAccessible::Footer; + QTest::newRow("ax::mojom::Role::kFooterAsNonLandmark") << QString("<article><footer>a</footer><article>") << 1 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kForm") << QString("<form></form>") << 0 << QAccessible::Form; + QTest::newRow("ax::mojom::Role::kGraphicsDocument") << QString("<div role='graphics-document'></div>") << 0 << QAccessible::Document; + QTest::newRow("ax::mojom::Role::kGraphicsObject") << QString("<div role='graphics-object'></div>") << 0 << QAccessible::Pane; + QTest::newRow("ax::mojom::Role::kGraphicsSymbol") << QString("<div role='graphics-symbol'></div>") << 0 << QAccessible::Graphic; + QTest::newRow("ax::mojom::Role::kGrid") << QString("<div role='grid'></div>") << 0 << QAccessible::Table; + QTest::newRow("ax::mojom::Role::kGroup") << QString("<fieldset></fieldset>") << 0 << QAccessible::Grouping; + QTest::newRow("ax::mojom::Role::Header") << QString("<header>a</header>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::HeaderAsNonLandMark") << QString("<article><header>a</header><article>") << 1 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kHeading") << QString("<h1>a</h1>") << 0 << QAccessible::Heading; + QTest::newRow("ax::mojom::Role::kIframe") << QString("<iframe>a</iframe>") << 1 << QAccessible::WebDocument; + QTest::newRow("ax::mojom::Role::kIframePresentational") << QString("<iframe role='presentation'>a</iframe>") << 1 << QAccessible::Grouping; + //QTest::newRow("ax::mojom::Role::kIgnored") << QString("<tag>a</tag>") << 0 << QAccessible::NoRole; // FIXME: The HTML element should not be exposed as an element (see AXNodeObject.cpp) + QTest::newRow("ax::mojom::Role::kImage") << QString("<img>") << 1 << QAccessible::Graphic; + //QTest::newRow("ax::mojom::Role::kImageMap") << QString("<img usemap='map'>") << 0 << QAccessible::Document; // FIXME: AXLayoutObject::DetermineAccessiblityRole returns kImageMap but something overrides it + //QTest::newRow("ax::mojom::Role::kInlineTextBox"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kInputTime") << QString("<input type='time'></input>") << 1 << QAccessible::SpinBox; + //QTest::newRow("ax::mojom::Role::kKeyboard"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kLabelText") << QString("<label>a</label>") << 1 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::kLayoutTable") << QString("<table><tr><td></td></tr></table>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kLayoutTableCell") << QString("<table><tr><td></td></tr></table>") << 2 << QAccessible::Section; + //QTest::newRow("ax::mojom::Role::kLayoutTableColumn") << QString("<table><tr></tr></table>") << 1 << QAccessible::Section; // FIXME: The test case might be wrong + QTest::newRow("ax::mojom::Role::kLayoutTableRow") << QString("<table><tr><td></td></tr></table>") << 1 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kLegend") << QString("<legend>a</legend>") << 0 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::kLineBreak") << QString("<br>") << 1 << QAccessible::Separator; + QTest::newRow("ax::mojom::Role::kLink") << QString("<a href=''>link</a>") << 1 << QAccessible::Link; + QTest::newRow("ax::mojom::Role::kList") << QString("<ul></ul>") << 0 << QAccessible::List; + QTest::newRow("ax::mojom::Role::kListBox") << QString("<select multiple></select>") << 1 << QAccessible::ComboBox; + QTest::newRow("ax::mojom::Role::kListBoxOption") << QString("<option>a</option>") << 0 << QAccessible::ListItem; + QTest::newRow("ax::mojom::Role::kListItem") << QString("<li>a</li>") << 0 << QAccessible::ListItem; + //QTest::newRow("ax::mojom::Role::kListGrid"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kListMarker") << QString("<li><ul></ul></li>") << 1 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::kLog") << QString("<div role='log'>a</div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kMain") << QString("<main>a</main>") << 0 << QAccessible::Grouping; + QTest::newRow("ax::mojom::Role::kMark") << QString("<mark>a</mark>") << 1 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::kMarquee") << QString("<div role='marquee'>a</div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kMath") << QString("<math>a</math>") << 1 << QAccessible::Equation; + QTest::newRow("ax::mojom::Role::kMenu") << QString("<div role='menu'>a</div>") << 0 << QAccessible::PopupMenu; + QTest::newRow("ax::mojom::Role::kMenuBar") << QString("<div role='menubar'>a</div>") << 0 << QAccessible::MenuBar; + QTest::newRow("ax::mojom::Role::kMenuItem") << QString("<menu role='menu'><input type='button' /></menu>") << 1 << QAccessible::MenuItem; + QTest::newRow("ax::mojom::Role::kMenuItemCheckBox") << QString("<menu role='menu'><input type='checkbox'></input></menu>") << 1 << QAccessible::CheckBox; + QTest::newRow("ax::mojom::Role::kMenuItemRadio") << QString("<menu role='menu'><input type='radio'></input></menu>") << 1 << QAccessible::RadioButton; + QTest::newRow("ax::mojom::Role::kMenuButton") << QString("<menu role='group'><div role='menuitem'>a</div></menu>") << 1 << QAccessible::MenuItem; + QTest::newRow("ax::mojom::Role::kMenuListOption") << QString("<select role='menu'><option>a</option></select>") << 3 << QAccessible::MenuItem; + QTest::newRow("ax::mojom::Role::kMenuListPopup") << QString("<select role='menu'><option>a</option></select>") << 2 << QAccessible::PopupMenu; + QTest::newRow("ax::mojom::Role::kMeter") << QString("<meter>a</meter>") << 1 << QAccessible::Chart; + QTest::newRow("ax::mojom::Role::kNavigation") << QString("<nav>a</nav>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kNote") << QString("<div role='note'>a</div>") << 0 << QAccessible::Note; + //QTest::newRow("ax::mojom::Role::kPane"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kParagraph") << QString("<p>a</p>") << 0 << QAccessible::Paragraph; + QTest::newRow("ax::mojom::Role::kPopUpButton") << QString("<select><option>a</option></select>") << 1 << QAccessible::ComboBox; + QTest::newRow("ax::mojom::Role::kPre") << QString("<pre>a</pre>") << 0 << QAccessible::Section; + //QTest::newRow("ax::mojom::Role::kPresentational") << QString("<div role='presentation'>a</div>") << 0 << QAccessible::NoRole; // FIXME: Aria role 'presentation' should work + QTest::newRow("ax::mojom::Role::kProgressIndicator") << QString("<div role='progressbar' aria-valuenow='77' aria-valuemin='22' aria-valuemax='99'></div>") << 0 << QAccessible::ProgressBar; + QTest::newRow("ax::mojom::Role::kRadioButton") << QString("<input type='radio'></input>") << 1 << QAccessible::RadioButton; + QTest::newRow("ax::mojom::Role::kRadioGroup") << QString("<fieldset role='radiogroup'></fieldset>") << 0 << QAccessible::Grouping; + QTest::newRow("ax::mojom::Role::kRegion") << QString("<div role='region'>a</div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kRow") << QString("<table role=table><tr><td>a</td></tr></table>") << 1 << QAccessible::Row; + QTest::newRow("ax::mojom::Role::kRowHeader") << QString("<table role=table><tr><th>a</td><td>b</td></tr></table>") << 2 << QAccessible::RowHeader; + QTest::newRow("ax::mojom::Role::kRuby") << QString("<ruby>a</ruby>") << 1 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::kRubyAnnotation") << QString("<ruby><rt>a</rt></ruby>") << 2 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::kScrollBar") << QString("<div role='scrollbar'>a</a>") << 0 << QAccessible::ScrollBar; + //QTest::newRow("ax::mojom::Role::kScrollView"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kSearch") << QString("<div role='search'>landmark</div>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kSearchBox") << QString("<input type='search'></input>") << 1 << QAccessible::EditableText; + QTest::newRow("ax::mojom::Role::kSection") << QString("<section></section>") << 0 << QAccessible::Section; + QTest::newRow("ax::mojom::Role::kSlider") << QString("<input type='range'>") << 1 << QAccessible::Slider; + //QTest::newRow("ax::mojom::Role::kSliderThumb") << QString("<input type='range'>") << 1 << QAccessible::Slider; // TODO: blink/renderer/modules/accessibility/ax_slider.cc + QTest::newRow("ax::mojom::Role::kSpinButton") << QString("<input type='number'></input>") << 1 << QAccessible::SpinBox; + QTest::newRow("ax::mojom::Role::kSplitter") << QString("<hr>") << 0 << QAccessible::Splitter; + QTest::newRow("ax::mojom::Role::kStaticText") << QString("a") << 1 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::kStatus") << QString("<output>a</output>") << 1 << QAccessible::Indicator; + QTest::newRow("ax::mojom::Role::kSvgRoot") << QString("<svg width='10' height='10'></svg>") << 1 << QAccessible::Graphic; + QTest::newRow("ax::mojom::Role::kSwitch") << QString("<button aria-checked='false'>a</button>") << 1 << QAccessible::Button; + QTest::newRow("ax::mojom::Role::kTable") << QString("<table role=table><td>a</td></table>") << 0 << QAccessible::Table; + //QTest::newRow("ax::mojom::Role::kTableHeaderContainer"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kTab") << QString("<div role='tab'>a</div>") << 0 << QAccessible::PageTab; + QTest::newRow("ax::mojom::Role::kTabList") << QString("<div role='tablist'>a</div>") << 0 << QAccessible::PageTabList; + QTest::newRow("ax::mojom::Role::kTabPanel") << QString("<div role='tabpanel'>a</div>") << 0 << QAccessible::Pane; + QTest::newRow("ax::mojom::Role::kTerm") << QString("<div role='term'>a</div>") << 0 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::kTextField") << QString("<input type='text'></input>") << 1 << QAccessible::EditableText; + QTest::newRow("ax::mojom::Role::kTime") << QString("<time>a</time>") << 1 << QAccessible::Clock; + QTest::newRow("ax::mojom::Role::kTimer") << QString("<div role='timer'>a</div>") << 0 << QAccessible::Clock; + //QTest::newRow("ax::mojom::Role::kTitleBar"); // No mapping to ARIA role + QTest::newRow("ax::mojom::Role::kToggleButton") << QString("<button aria-pressed='false'>a</button>") << 1 << QAccessible::Button; + QTest::newRow("ax::mojom::Role::kToolbar") << QString("<div role='toolbar'>a</div>") << 0 << QAccessible::ToolBar; + QTest::newRow("ax::mojom::Role::kToolTip") << QString("<div role='tooltip'>a</div>") << 0 << QAccessible::ToolTip; + QTest::newRow("ax::mojom::Role::kTree") << QString("<div role='tree'>a</div>") << 0 << QAccessible::Tree; + QTest::newRow("ax::mojom::Role::kTreeGrid") << QString("<div role='treegrid'>a</div>") << 0 << QAccessible::Tree; + QTest::newRow("ax::mojom::Role::kTreeItem") << QString("<div role='treeitem'>a</div>") << 0 << QAccessible::TreeItem; + QTest::newRow("ax::mojom::Role::kVideo") << QString("<video><source src='test.mp4' type='video/mp4'></video>") << 1 << QAccessible::Animation; + //QTest::newRow("ax::mojom::Role::kWindow"); // No mapping to ARIA role } void tst_Accessibility::roles() |