Bug 681615 - Move a couple of tests from content/html/content/test to content/html/content/test/forms; r=mounir

--HG--
rename : content/html/content/test/test_bug555840.html => content/html/content/test/forms/test_datalist_element.html
rename : content/html/content/test/test_bug556007.html => content/html/content/test/forms/test_input_list_attribute.html
rename : content/html/content/test/test_bug345624-2.html => content/html/content/test/forms/test_maxlength_attribute.html
rename : content/html/content/test/test_bug345624-1.html => content/html/content/test/forms/test_validation.html
This commit is contained in:
Ms2ger 2011-08-25 10:45:53 +02:00
Родитель cba35094d2
Коммит 467aabd2aa
7 изменённых файлов: 49 добавлений и 78 удалений

Просмотреть файл

@ -197,8 +197,6 @@ _TEST_FILES = \
test_bug573969.html \
test_bug549475.html \
test_bug585508.html \
test_bug345624-1.html \
test_bug345624-2.html \
test_bug561640.html \
test_bug566064.html \
test_bug582412-1.html \
@ -213,7 +211,6 @@ _TEST_FILES = \
test_bug590353-1.html \
test_bug590353-2.html \
test_bug593689.html \
test_bug555840.html \
test_bug561636.html \
test_bug590363.html \
test_bug557628.html \
@ -221,7 +218,6 @@ _TEST_FILES = \
test_bug595429.html \
test_bug595447.html \
test_bug595449.html \
test_bug595457.html \
test_bug557087-1.html \
test_bug557087-2.html \
test_bug557087-3.html \
@ -234,7 +230,6 @@ _TEST_FILES = \
test_bug596350.html \
test_bug598833-1.html \
test_bug600155.html \
test_bug556007.html \
test_bug606817.html \
test_bug297761.html \
file_bug297761.html \

Просмотреть файл

@ -48,6 +48,7 @@ _TEST_FILES = \
test_save_restore_radio_groups.html \
test_mozistextfield.html \
test_input_attributes_reflection.html \
test_input_list_attribute.html \
test_input_email.html \
test_input_url.html \
test_pattern_attribute.html \
@ -59,6 +60,9 @@ _TEST_FILES = \
test_output_element.html \
test_button_attributes_reflection.html \
test_textarea_attributes_reflection.html \
test_validation.html \
test_maxlength_attribute.html \
test_datalist_element.html \
$(NULL)
libs:: $(_TEST_FILES)

Просмотреть файл

@ -1,15 +1,11 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=555840
-->
<head>
<title>Test for Bug 555840</title>
<title>Test for the datalist element</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.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=555840">Mozilla Bug 555840</a>
<p id="display"></p>
<div id="content" style="display: none">
<datalist>
@ -55,26 +51,62 @@ function checkOptions()
[['option', 'option'], function(d) { d.childNodes[0].value = 'value'; }, 2],
[['option', 'option'], function(d) { d.childNodes[0].label = 'label'; }, 2],
[['option', 'option'], function(d) { d.childNodes[0].value = 'value'; d.childNodes[0].label = 'label'; }, 2],
[['select'],
function(d) {
var s = d.childNodes[0];
s.appendChild(new Option("foo"));
s.appendChild(new Option("bar"));
},
2],
[['select'],
function(d) {
var s = d.childNodes[0];
s.appendChild(new Option("foo"));
s.appendChild(new Option("bar"));
var label = document.createElement("label");
d.appendChild(label);
label.appendChild(new Option("foobar"));
},
3],
[['select'],
function(d) {
var s = d.childNodes[0];
s.appendChild(new Option("foo"));
s.appendChild(new Option("bar"));
var label = document.createElement("label");
d.appendChild(label);
label.appendChild(new Option("foobar"));
s.appendChild(new Option())
},
4],
[[], function(d) { d.appendChild(document.createElementNS("foo", "option")); }, 0]
];
var d = document.getElementsByTagName('datalist')[0];
var cachedOptions = d.options;
for each (data in testData) {
for each (e in data[0]) {
testData.forEach(function(data) {
data[0].forEach(function(e) {
d.appendChild(document.createElement(e));
}
})
/* Modify children. */
if (data[1]) {
data[1](d);
}
is(d.options, cachedOptions, "Should get the same object")
is(d.options.length, data[2],
"The number of recognized options should be " + data[2])
for (var i = 0; i < d.options.length; ++i) {
is(d.options[i].localName, "option",
"Should get an option for d.options[" + i + "]")
}
/* Cleaning-up. */
for (; d.firstChild; d.removeChild(d.firstChild));
}
d.textContent = "";
})
}
checkClassesAndAttributes();

Просмотреть файл

@ -61,9 +61,9 @@ function checkTooLongValidity(element)
todo(!element.validity.valid,
"Element should not be valid when it is too long");
todo(element.validationMessage,
"Please shorten this text to 2 characters or less (you are currently using 3 characters).",
"The validation message text is not correct");
todo_is(element.validationMessage,
"Please shorten this text to 2 characters or less (you are currently using 3 characters).",
"The validation message text is not correct");
todo(!element.checkValidity(), "The element should not be valid");
element.setCustomValidity("custom message");
is(window.getComputedStyle(element, null).getPropertyValue('background-color'),

Просмотреть файл

@ -1,60 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=595457
-->
<head>
<title>Test for Bug 595457</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.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=595457">Mozilla Bug 595457</a>
<p id="display"></p>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 595457 **/
function checkDatalistOptions(aDatalist, aOptions)
{
var datalistOptions = datalist.options;
var length = datalistOptions.length;
is(length, options.length, "datalist should have " + options.length + " options");
for (var i=0; i<length; ++i) {
is(datalistOptions[i], options[i], options[i] +
"should be in the datalist options");
}
}
var datalist = document.createElement("datalist");
var select = document.createElement("select");
var options = [ new Option("foo"), new Option("bar") ];
datalist.appendChild(select);
for each(option in options) {
select.appendChild(option);
}
checkDatalistOptions(datalist, options);
var label = document.createElement("label");
datalist.appendChild(label);
options[2] = new Option("foobar");
label.appendChild(options[2]);
checkDatalistOptions(datalist, options);
options[3] = new Option();
datalist.appendChild(options[3]);
checkDatalistOptions(datalist, options);
</script>
</pre>
</body>
</html>