gecko-dev/layout/forms/test/test_bug563642.html
Brian Grinstead ede8c44ef2 Bug 1544322 - Part 2.1 - Remove the [type] attribute for one-liner <script> tags loading files in /tests/SimpleTest/ in everything except for dom/ r=bzbarsky
This excludes dom/, otherwise the file size is too large for phabricator to handle.

This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 2` argument.

Differential Revision: https://phabricator.services.mozilla.com/D27456

--HG--
extra : moz-landing-system : lando
2019-04-16 03:50:44 +00:00

86 lines
2.2 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=563642
-->
<head>
<title>Test for Bug 563642</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=563642">Mozilla Bug 563642</a>
<p id="display">
<select id="test1" multiple="multiple" size="1">
<option>Item 1</option>
<option>Item 2</option>
<option>Item 3</option>
<option>Item 4</option>
<option>Item 5</option>
</select>
<select id="test2" multiple="multiple" size="1">
<option>Item 1</option>
<option disabled>Item 2</option>
<option>Item 3</option>
<option disabled>Item 4</option>
<option>Item 5</option>
</select>
<select id="test3" multiple="multiple"></select>
<select id="test4" multiple="multiple" size="1"></select>
</p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 563642 **/
function pageUpDownTest(id,index) {
var elm = document.getElementById(id);
elm.focus();
elm.selectedIndex = 0;
sendKey("page_down");
sendKey("page_down");
sendKey("page_down");
sendKey("page_up");
sendKey("page_down");
is(elm.selectedIndex, index, "pageUpDownTest: selectedIndex for " + id + " is " + index);
}
function upDownTest(id,index) {
var elm = document.getElementById(id);
elm.focus();
elm.selectedIndex = 0;
sendKey("down");
sendKey("down");
sendKey("down");
sendKey("up");
sendKey("down");
is(elm.selectedIndex, index, "upDownTest: selectedIndex for " + id + " is " + index);
}
function runTest() {
pageUpDownTest("test1",3);
pageUpDownTest("test2",4);
pageUpDownTest("test3",-1);
pageUpDownTest("test4",-1);
upDownTest("test1",3);
upDownTest("test2",4);
upDownTest("test3",-1);
upDownTest("test4",-1);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation because it hijacks down and up key events.
SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, runTest);
})
</script>
</pre>
</body>
</html>