<!DOCTYPE HTML><html><!--https://bugzilla.mozilla.org/show_bug.cgi?id=603556--><head><title>Test for Bug 603556</title><scriptsrc="/tests/SimpleTest/SimpleTest.js"></script><scriptsrc="/tests/SimpleTest/EventUtils.js"></script><linkrel="stylesheet"type="text/css"href="/tests/SimpleTest/test.css"/></head><body><atarget="_blank"href="https://bugzilla.mozilla.org/show_bug.cgi?id=603556">Mozilla Bug 603556</a><pid="display"></p><divid="content"><divid="src">testing</div><inputmaxlength="4"></div><preid="test"><scripttype="application/javascript">/** Test for Bug 603556 **/SimpleTest.waitForExplicitFinish();SimpleTest.waitForFocus(function(){vari=document.querySelector("input");varsrc=document.getElementById("src");SimpleTest.waitForClipboard(src.textContent,function(){getSelection().selectAllChildren(src);synthesizeKey("C",{accelKey:true});},function(){i.focus();synthesizeKey("V",{accelKey:true});if(!SpecialPowers.getBoolPref("editor.truncate_user_pastes")){is(i.value,src.textContent,"Pasting should paste the clipboard contents regardless of maxlength");}else{is(i.value,src.textContent.substr(0,i.maxLength),"Pasting should paste maxlength chars worth of the clipboard contents");}SimpleTest.finish();},function(){SimpleTest.finish();});});</script></pre></body></html>