browser_treeupdate_ariadialog.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. 'use strict';
  5. /* global EVENT_SHOW, ROLE_DIALOG, ROLE_PUSHBUTTON, ROLE_TEXT_LEAF, ROLE_ENTRY,
  6. ROLE_DOCUMENT */
  7. loadScripts({ name: 'role.js', dir: MOCHITESTS_DIR });
  8. // Test ARIA Dialog
  9. addAccessibleTask('doc_treeupdate_ariadialog.html', function*(browser, accDoc) {
  10. testAccessibleTree(accDoc, {
  11. role: ROLE_DOCUMENT,
  12. children: [ ]
  13. });
  14. // Make dialog visible and update its inner content.
  15. let onShow = waitForEvent(EVENT_SHOW, 'dialog');
  16. yield ContentTask.spawn(browser, {}, () => {
  17. content.document.getElementById('dialog').style.display = 'block';
  18. });
  19. yield onShow;
  20. testAccessibleTree(accDoc, {
  21. role: ROLE_DOCUMENT,
  22. children: [
  23. {
  24. role: ROLE_DIALOG,
  25. children: [
  26. {
  27. role: ROLE_PUSHBUTTON,
  28. children: [ { role: ROLE_TEXT_LEAF } ]
  29. },
  30. {
  31. role: ROLE_ENTRY
  32. }
  33. ]
  34. }
  35. ]
  36. });
  37. });