Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / copy-in-password-field.html
blob14e3312d031483c2f19cac25df3e0c6195b67009
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <script>
5 function test() {
6 // Overwrite the old pasteboard with default results
7 document.getElementById("text").focus();
8 document.getElementById("text").select();
9 document.execCommand("Copy");
11 // Try to copy a password
12 document.getElementById("password").focus();
13 document.getElementById("password").select();
14 document.execCommand("Copy");
16 // Paste
17 document.getElementById("text").focus();
18 document.getElementById("text").select();
19 document.execCommand("Paste");
21 shouldBe('document.getElementById("text").value', '"[not modified]"');
23 </script>
24 </head>
25 <body onload="test()">
26 <p>This test verifies that copying is disabled for password fields by attempting to
27 copy from a password field and paste into a textfield. If the test
28 passes, you'll see a of 'PASS' message below, and the textfield will remain unmodified.</p>
29 <p>(The test is only meaningful in debug builds, since paste is disabled in release builds.)</p>
30 <input type="password" id="password" value="Password Input">
31 <input type="text" id="text" value="[not modified]">
32 <hr>
33 <p id="console"></p>
34 </body>
35 </html>