Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: toolkit/content/tests/chrome/chrome.toml
<?xml version="1.0"?>↩
<!--↩
-->↩
↩
↩
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=365773">Mozilla Bug 365773</a>↩
<p id="display">↩
<radiogroup id="group" collapsed="true" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">↩
<radio id="item" label="Item"/>↩
</radiogroup>↩
</p>↩
<div id="content" style="display: none">↩
</div>↩
<pre id="test">↩
</pre>↩
</body>↩
↩
<script class="testbody" type="application/javascript">↩
<![CDATA[↩
↩
↩
function selectItem(item, isIndex, testName) {↩
var exception = null;↩
try {↩
if (isIndex)↩
document.getElementById("group").selectedIndex = item;↩
else↩
document.getElementById("group").selectedItem = item;↩
}↩
catch(e) {↩
exception = e;↩
}↩
↩
ok(exception == null, testName);↩
}↩
↩
SimpleTest.waitForExplicitFinish();↩
↩
window.onload = function runTests() {↩
var item = document.getElementById("item");↩
↩
selectItem(item, false, "Radio button selected with selectedItem (not focused)");↩
selectItem(null, false, "Radio button deselected with selectedItem (not focused)");↩
selectItem(0, true, "Radio button selected with selectedIndex (not focused)");↩
selectItem(-1, true, "Radio button deselected with selectedIndex (not focused)");↩
↩
document.getElementById("group").focus();↩
↩
selectItem(item, false, "Radio button selected with selectedItem (focused)");↩
selectItem(null, false, "Radio button deselected with selectedItem (focused)");↩
selectItem(0, true, "Radio button selected with selectedIndex (focused)");↩
selectItem(-1, true, "Radio button deselected with selectedIndex (focused)");↩
↩
SimpleTest.finish();↩
};↩
]]>↩
</script>↩
↩
</window>↩