mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 01:47:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
96
accessible/tests/mochitest/test_nsIAccessibleDocument.html
Normal file
96
accessible/tests/mochitest/test_nsIAccessibleDocument.html
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=441737
|
||||
-->
|
||||
<head>
|
||||
<title>nsIAccessibleDocument chrome tests</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 type="application/javascript"
|
||||
src="common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="states.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/chrome-harness.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
{
|
||||
var docAcc = getAccessible(document, [nsIAccessibleDocument]);
|
||||
if (docAcc) {
|
||||
// nsIAccessible
|
||||
is(docAcc.name, "nsIAccessibleDocument chrome tests",
|
||||
"Name for document accessible not correct!");
|
||||
|
||||
testRole(docAcc, ROLE_DOCUMENT);
|
||||
|
||||
// check if it is focusable, read-only.
|
||||
testStates(docAcc, (STATE_READONLY | STATE_FOCUSABLE));
|
||||
|
||||
// No actions wanted on doc
|
||||
is(docAcc.actionCount, 0, "Wrong number of actions for document!");
|
||||
|
||||
// attributes should contain tag:body
|
||||
attributes = docAcc.attributes;
|
||||
is(attributes.getStringProperty("tag"), "body",
|
||||
"Wrong attribute on document!");
|
||||
|
||||
// Document URL.
|
||||
var rootDir = getRootDirectory(window.location.href);
|
||||
is(docAcc.URL, rootDir + "test_nsIAccessibleDocument.html",
|
||||
"Wrong URL for document!");
|
||||
|
||||
// Document title and mime type.
|
||||
is(docAcc.title, "nsIAccessibleDocument chrome tests",
|
||||
"Wrong title for document!");
|
||||
is(docAcc.mimeType, "text/html",
|
||||
"Wrong mime type for document!");
|
||||
|
||||
// DocAccessible::getDocType currently returns NS_ERROR_FAILURE.
|
||||
// See bug 442005. After fixing, please remove this comment and
|
||||
// uncomment the below two lines to enable the test.
|
||||
// is(docAcc.docType, "HTML",
|
||||
// "Wrong type of document!");
|
||||
|
||||
// Test for correct nsIDOMDocument retrieval.
|
||||
var domDoc = null;
|
||||
try {
|
||||
domDoc = docAcc.DOMDocument.QueryInterface(nsIDOMDocument);
|
||||
} catch(e) {}
|
||||
ok(domDoc, "no nsIDOMDocument for this doc accessible!");
|
||||
is(domDoc, document, "Document nodes do not match!");
|
||||
|
||||
// Test for correct nsIDOMWindow retrieval.
|
||||
var domWindow = null;
|
||||
try {
|
||||
domWindow = docAcc.window.QueryInterface(nsIDOMWindow);
|
||||
} catch(e) {}
|
||||
ok(domWindow, "no nsIDOMWindow for this doc accessible!");
|
||||
is(domWindow, window, "Window nodes do not match!");
|
||||
}
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=441737"
|
||||
title="nsAccessibleDocument chrome tests">
|
||||
Mozilla Bug 441737
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue