Bug 456229 - tests for <input type="search">. r=smaug

This commit is contained in:
Mounir Lamouri 2010-05-17 12:20:20 +02:00
parent d42236f376
commit 4b22b4cebf
9 changed files with 87 additions and 0 deletions

View File

@ -168,6 +168,7 @@ _TEST_FILES = test_bug589.html \
test_bug555567.html \
test_bug557620.html \
test_bug565538.html \
test_bug456229.html \
$(NULL)
libs:: $(_TEST_FILES)

View File

@ -0,0 +1,31 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=456229
-->
<head>
<title>Test for Bug 456229</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<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=456229">Mozilla Bug 456229</a>
<p id="display"></p>
<div id="content" style="display: none">
<input id='i' type="search">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 456229 **/
// More checks are done in test_bug551670.html.
var i = document.getElementById('i');
is(i.type, 'search', "Search state should be recognized");
</script>
</pre>
</body>
</html>

View File

@ -92,6 +92,7 @@ checkType(document.getElementById('i1'), document.getElementById('i2'), 'text',
checkType(document.getElementById('i1'), document.getElementById('i2'), 'text', 'radio', wrongType);
checkType(document.getElementById('i1'), document.getElementById('i2'), 'text', 'submit', wrongType);
checkType(document.getElementById('i1'), document.getElementById('i2'), 'text', 'tel', wrongType);
checkType(document.getElementById('i1'), document.getElementById('i2'), 'text', 'search', wrongType);
</script>
</pre>

View File

@ -1 +1,2 @@
include tel/reftest.list
include search/reftest.list

View File

@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
<!-- Test: input element in search state looks like in text state -->
<body>
<input type="search">
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: input element in search state looks like in text state -->
<script type="text/javascript">
function setToSearch()
{
document.getElementById('i').type = 'search';
}
function disableReftestWait()
{
document.documentElement.className = '';
}
</script>
<body onload="setToSearch(); disableReftestWait();">
<input type='checkbox' id='i'>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when switching to another type, the input element should not look
like an input search element -->
<script type="text/javascript">
function setToCheckbox()
{
document.getElementById('i').type = 'checkbox';
}
function disableReftestWait()
{
document.documentElement.className = '';
}
</script>
<body onload="setToCheckbox(); disableReftestWait();">
<input type='search' id='i'>
</body>
</html>

View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<input type="text">
</body>
</html>

View File

@ -0,0 +1,3 @@
== input-search-1.html input-search-ref.html
== input-search-2.html input-search-ref.html
!= input-search-3.html input-search-ref.html