2010-01-20 11:16:32 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<title>Event object attributes 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="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
2010-09-01 22:09:56 +00:00
|
|
|
src="../common.js"></script>
|
2010-01-20 11:16:32 +00:00
|
|
|
<script type="application/javascript"
|
2010-09-01 22:09:56 +00:00
|
|
|
src="../events.js"></script>
|
2010-01-20 11:16:32 +00:00
|
|
|
<script type="application/javascript"
|
2010-09-01 22:09:56 +00:00
|
|
|
src="../attributes.js"></script>
|
2010-01-20 11:16:32 +00:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test "event-from-input" object attribute.
|
|
|
|
*/
|
2011-09-28 01:46:11 +00:00
|
|
|
function eventFromInputChecker(aEventType, aID, aValue, aNoTargetID)
|
2010-01-20 11:16:32 +00:00
|
|
|
{
|
2011-09-28 01:46:11 +00:00
|
|
|
this.type = aEventType;
|
|
|
|
this.target = getAccessible(aID);
|
|
|
|
|
2010-01-20 11:16:32 +00:00
|
|
|
this.noTarget = getNode(aNoTargetID);
|
|
|
|
|
|
|
|
this.check = function checker_check(aEvent)
|
|
|
|
{
|
|
|
|
testAttrs(aEvent.accessible, { "event-from-input": aValue }, true);
|
|
|
|
|
|
|
|
var accessible = getAccessible(this.noTarget);
|
|
|
|
testAbsentAttrs(accessible, { "event-from-input": "" });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Do tests.
|
|
|
|
*/
|
|
|
|
var gQueue = null;
|
|
|
|
|
|
|
|
// gA11yEventDumpID = "eventdump"; // debug stuff
|
2011-09-28 01:46:11 +00:00
|
|
|
//gA11yEventDumpToConsole = true; // debug stuff
|
2010-01-20 11:16:32 +00:00
|
|
|
|
|
|
|
function doTests()
|
|
|
|
{
|
|
|
|
gQueue = new eventQueue();
|
|
|
|
|
|
|
|
var id = "textbox", noTargetId = "textarea";
|
2011-09-28 01:46:11 +00:00
|
|
|
var checker =
|
|
|
|
new eventFromInputChecker(EVENT_FOCUS, id, "false", noTargetId);
|
|
|
|
gQueue.push(new synthFocus(id, checker));
|
|
|
|
|
2010-01-21 16:32:30 +00:00
|
|
|
if (!MAC) { // Mac failure is bug 541093
|
2011-09-28 01:46:11 +00:00
|
|
|
var checker =
|
2012-11-20 04:53:38 +00:00
|
|
|
new eventFromInputChecker(EVENT_TEXT_CARET_MOVED, id, "true", noTargetId);
|
2011-09-28 01:46:11 +00:00
|
|
|
gQueue.push(new synthHomeKey(id, checker));
|
2010-01-21 16:32:30 +00:00
|
|
|
}
|
2010-01-20 11:16:32 +00:00
|
|
|
|
|
|
|
gQueue.invoke(); // Will call SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
addA11yLoadEvent(doTests);
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=540285"
|
|
|
|
title="Event object attributes testing">
|
|
|
|
Mozilla Bug 540285
|
|
|
|
</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<input id="textbox" value="hello">
|
|
|
|
<textarea id="textarea"></textarea>
|
|
|
|
|
|
|
|
<div id="eventdump"></div>
|
|
|
|
</body>
|
|
|
|
</html>
|