summaryrefslogtreecommitdiffstats
path: root/accessible/tests/browser/e10s/browser_caching_interfaces.js
blob: 98e86410762429ed53bd4d2ca114db766614a1ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

/**
 * Test caching of accessible interfaces
 */
addAccessibleTask(
  `
  <img id="img" src="http://example.com/a11y/accessible/tests/mochitest/moz.png">
  <select id="select" multiple></select>
  <input id="number-input" type="number">
  <table id="table">
    <tr><td id="cell"><a id="link" href="#">hello</a></td></tr>
  </table>
  `,
  async function(browser, accDoc) {
    ok(
      accDoc instanceof nsIAccessibleDocument,
      "Document has Document interface"
    );
    ok(
      accDoc instanceof nsIAccessibleHyperText,
      "Document has HyperText interface"
    );
    ok(
      findAccessibleChildByID(accDoc, "img") instanceof nsIAccessibleImage,
      "img has Image interface"
    );
    ok(
      findAccessibleChildByID(accDoc, "select") instanceof
        nsIAccessibleSelectable,
      "select has Selectable interface"
    );
    ok(
      findAccessibleChildByID(accDoc, "number-input") instanceof
        nsIAccessibleValue,
      "number-input has Value interface"
    );
    ok(
      findAccessibleChildByID(accDoc, "table") instanceof nsIAccessibleTable,
      "table has Table interface"
    );
    ok(
      findAccessibleChildByID(accDoc, "cell") instanceof nsIAccessibleTableCell,
      "cell has TableCell interface"
    );
    ok(
      findAccessibleChildByID(accDoc, "link") instanceof nsIAccessibleHyperLink,
      "link has HyperLink interface"
    );
    ok(
      findAccessibleChildByID(accDoc, "link") instanceof nsIAccessibleHyperText,
      "link has HyperText interface"
    );
  }
);