blob: 64a2b5bda77ac83b04d6691543be1407170ce2f3 [file] [log] [blame]
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script>
function test() {
if (window.testRunner)
testRunner.dumpEditingCallbacks();
// Overwrite the old pasteboard with default results
document.getElementById("text").focus();
document.execCommand("Copy");
// Try to copy a password
document.getElementById("password").focus();
document.execCommand("Copy");
// Paste
document.getElementById("text").focus();
document.execCommand("Paste");
shouldBe('document.getElementById("text").value', '"[not modified]"');
}
</script>
</head>
<body onload="test()">
<p>This test verifies that copying is disabled for password fields by attempting to
copy from a password field and paste into a textfield. If the test
passes, you'll see a of 'PASS' message below, and the textfield will remain unmodified.</p>
<p>(The test is only meaningful in debug builds, since paste is disabled in release builds.)</p>
<input type="password" id="password" value="Password Input">
<input type="text" id="text" value="[not modified]">
<hr>
<p id="console"></p>
</body>
</html>