diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /accessible/tests/mochitest/aom | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'accessible/tests/mochitest/aom')
-rw-r--r-- | accessible/tests/mochitest/aom/a11y.ini | 3 | ||||
-rw-r--r-- | accessible/tests/mochitest/aom/test_general.html | 55 |
2 files changed, 58 insertions, 0 deletions
diff --git a/accessible/tests/mochitest/aom/a11y.ini b/accessible/tests/mochitest/aom/a11y.ini new file mode 100644 index 000000000..03085c1de --- /dev/null +++ b/accessible/tests/mochitest/aom/a11y.ini @@ -0,0 +1,3 @@ +[DEFAULT] + +[test_general.html] diff --git a/accessible/tests/mochitest/aom/test_general.html b/accessible/tests/mochitest/aom/test_general.html new file mode 100644 index 000000000..5812ac55f --- /dev/null +++ b/accessible/tests/mochitest/aom/test_general.html @@ -0,0 +1,55 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>Accessibility API: generic</title> + <link rel="stylesheet" type="text/css" + href="chrome://mochikit/content/tests/SimpleTest/test.css"> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <script> + 'use strict'; + + SimpleTest.waitForExplicitFinish(); + const finish = SimpleTest.finish.bind(SimpleTest); + enablePref() + .then(createIframe) + .then(checkImplementation) + .catch(err => { + dump(`${err}: ${err.stack}`); + finish(); + }); + + function enablePref() { + const ops = { + "set": [ + [ "accessibility.AOM.enabled", true ], + ], + }; + return SpecialPowers.pushPrefEnv(ops); + } + + // WebIDL conditional annotations for an interface are evaluated once per + // global, so we need to create an iframe to see the effects of calling + // enablePref(). + function createIframe() { + return new Promise((resolve) => { + let iframe = document.createElement("iframe"); + iframe.src = "about:blank"; + iframe.onload = () => resolve(iframe.contentDocument); + document.body.appendChild(iframe); + }); + } + + // Check that the WebIDL is as expected. + function checkImplementation(ifrDoc) { + let anode = ifrDoc.accessibleNode; + ok(anode, "DOM document has accessible node"); + + is(anode.role, 'document', 'correct role of a document accessible node'); + is(anode.DOMNode, ifrDoc, 'correct DOM Node of a document accessible node'); + + finish(); + } + </script> +</head> |