1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/base/tests/test_bug858459.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=858459 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 858459</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <script type="text/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 + /** Test for Bug 858459 **/ 1.18 + 1.19 +var result = ""; 1.20 +var timeout = null; 1.21 +var clicks = 0; 1.22 +const EXPECTED_RESULT = "change select"; 1.23 + 1.24 +function logEvent(ev,msg) { 1.25 + result += ev.type + ' ' + msg; 1.26 + ++clicks; 1.27 + if (result.length > EXPECTED_RESULT.length) 1.28 + finishTest(); 1.29 +} 1.30 + 1.31 +document.onclick = function(event) { logEvent(event,"document"); } 1.32 + 1.33 +SimpleTest.waitForExplicitFinish(); 1.34 + 1.35 +function finishTest() { 1.36 + if (!timeout) return; 1.37 + clearTimeout(timeout); 1.38 + timeout = null; 1.39 + is(result,EXPECTED_RESULT,""); 1.40 + SimpleTest.finish(); 1.41 +} 1.42 + 1.43 +function runTest() { 1.44 + // Need a timeout to check that an event has _not_ occurred. 1.45 + timeout = setTimeout(finishTest, 5000); 1.46 + synthesizeMouseAtCenter(document.getElementById('test858459'), { }); 1.47 +} 1.48 + 1.49 + </script> 1.50 +</head> 1.51 +<body onload="SimpleTest.waitForFocus(runTest)"> 1.52 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=858459">Mozilla Bug 858459</a> 1.53 +<p id="display"></p> 1.54 +<div id="content" style="display: none"> 1.55 + 1.56 +</div> 1.57 +<pre id="test"><div><select id="test858459" size=4 onclick="logEvent(event,'select');" onchange="logEvent(event,'select');var div = document.querySelector('#test div'); div.innerHTML='<p>'+div.innerHTML; document.body.offsetHeight;"><option>1111111111111111<option>2<option>3</select></div> 1.58 + 1.59 +</pre> 1.60 +</body> 1.61 +</html>