1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/forms/test/test_listcontrol_search.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=849438 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for <select> list control search</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> 1.14 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.15 + <script type="application/javascript"> 1.16 + 1.17 + /** This test will focus a select element and press a key that matches the 1.18 + first non-space character of an entry. **/ 1.19 + 1.20 + SimpleTest.waitForExplicitFinish(); 1.21 + SimpleTest.waitForFocus(function() { 1.22 + var select = document.getElementsByTagName('select')[0]; 1.23 + select.focus(); 1.24 + synthesizeKey('a', {}); 1.25 + 1.26 + is(select.options[0].selected, false, "the first option isn't selected"); 1.27 + is(select.options[1].selected, true, "the second option is selected"); 1.28 + 1.29 + select.blur(); 1.30 + 1.31 + SimpleTest.finish(); 1.32 + }); 1.33 + 1.34 + </script> 1.35 +</head> 1.36 +<body> 1.37 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=849438">Mozilla Bug 849438</a> 1.38 +<p id="display"></p> 1.39 +<div id="content"> 1.40 + <select> 1.41 + <option>Please select an entry</option> 1.42 + <option> a</option> 1.43 + <option> b</option> 1.44 + </select> 1.45 +</div> 1.46 +<pre id="test"> 1.47 +</pre> 1.48 +</body> 1.49 +</html>