summaryrefslogtreecommitdiffstats
path: root/accessible/tests/browser/e10s/browser_treeupdate_listener.js
blob: 735f7871af91877f3e6e0b52e539a39252167223 (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
/* 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";

/* import-globals-from ../../mochitest/role.js */
loadScripts({ name: "role.js", dir: MOCHITESTS_DIR });

addAccessibleTask(
  '<span id="parent"><span id="child"></span></span>',
  async function (browser, accDoc) {
    is(
      findAccessibleChildByID(accDoc, "parent"),
      null,
      "Check that parent is not accessible."
    );
    is(
      findAccessibleChildByID(accDoc, "child"),
      null,
      "Check that child is not accessible."
    );

    let onReorder = waitForEvent(EVENT_REORDER, matchContentDoc);
    // Add an event listener to parent.
    await invokeContentTask(browser, [], () => {
      content.window.dummyListener = () => {};
      content.document
        .getElementById("parent")
        .addEventListener("click", content.window.dummyListener);
    });
    await onReorder;

    let tree = { TEXT: [] };
    testAccessibleTree(findAccessibleChildByID(accDoc, "parent"), tree);
  },
  { iframe: true, remoteIframe: true }
);