fune/dom/html/test/test_bug615833.html
Brian Grinstead 0d460e3432 Bug 1544322 - Part 2.2 - Remove the [type] attribute for one-liner <script> tags loading files in /tests/SimpleTest/ in dom/ r=bzbarsky
This is split from the previous changeset since if we include dom/ 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/D27457

--HG--
extra : moz-landing-system : lando
2019-04-16 03:53:28 +00:00

141 lines
3.5 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=615697
-->
<head>
<title>Test for Bug 615697</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=615697">Mozilla Bug 615697</a>
<p id="display"></p>
<div id="content">
<input>
<textarea></textarea>
<input type='radio'>
<input type='checkbox'>
<select>
<option>foo</option>
<option>bar</option>
</select>
<select multiple size='1'>
<option>tulip</option>
</select>
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 615697 **/
/**
* This test is making all elements trigger 'change' event.
* You should read the test from bottom to top:
* events are registered from the last one to the first one.
*
* Sometimes, elements are focused before a click. This might sound useless
* but it guarantees to have the element visible before simulating the click.
*/
var input = document.getElementsByTagName('input')[0];
var textarea = document.getElementsByTagName('textarea')[0];
var radio = document.getElementsByTagName('input')[1];
var checkbox= document.getElementsByTagName('input')[2];
var select = document.getElementsByTagName('select')[0];
var selectMultiple = document.getElementsByTagName('select')[1];
function checkChangeEvent(aEvent)
{
ok(aEvent.bubbles, "change event should bubble");
ok(!aEvent.cancelable, "change event shouldn't be cancelable");
}
selectMultiple.addEventListener("change", function(aEvent) {
checkChangeEvent(aEvent);
SimpleTest.finish();
}, {once: true});
selectMultiple.addEventListener("focus", function() {
SimpleTest.executeSoon(function () {
synthesizeMouseAtCenter(selectMultiple, {});
});
}, {once: true});
select.addEventListener("change", function(aEvent) {
checkChangeEvent(aEvent);
selectMultiple.focus();
}, {once: true});
select.addEventListener("keyup", function() {
select.blur();
}, {once: true});
select.addEventListener("focus", function() {
SimpleTest.executeSoon(function () {
synthesizeKey("KEY_ArrowDown");
});
}, {once: true});
checkbox.addEventListener("change", function(aEvent) {
checkChangeEvent(aEvent);
select.focus();
}, {once: true});
checkbox.addEventListener("focus", function() {
SimpleTest.executeSoon(function () {
synthesizeMouseAtCenter(checkbox, {});
});
}, {once: true});
radio.addEventListener("change", function(aEvent) {
checkChangeEvent(aEvent);
checkbox.focus();
}, {once: true});
radio.addEventListener("focus", function() {
SimpleTest.executeSoon(function () {
synthesizeMouseAtCenter(radio, {});
});
}, {once: true});
textarea.addEventListener("change", function(aEvent) {
checkChangeEvent(aEvent);
radio.focus();
}, {once: true});
textarea.addEventListener("input", function() {
textarea.blur();
}, {once: true});
textarea.addEventListener("focus", function() {
SimpleTest.executeSoon(function () {
sendString("f");
});
}, {once: true});
input.addEventListener("change", function(aEvent) {
checkChangeEvent(aEvent);
textarea.focus();
}, {once: true});
input.addEventListener("input", function() {
input.blur();
}, {once: true});
input.addEventListener("focus", function() {
SimpleTest.executeSoon(function () {
sendString("f");
});
}, {once: true});
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(function() {
input.focus();
});
</script>
</pre>
</body>
</html>