Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 function test() { | 5 function test() { |
| 6 if (window.testRunner) | 6 if (window.testRunner) |
| 7 testRunner.dumpEditingCallbacks(); | 7 testRunner.dumpEditingCallbacks(); |
| 8 | 8 |
| 9 // Overwrite the old pasteboard with default results | 9 // Overwrite the old pasteboard with default results |
| 10 document.getElementById("text").focus(); | 10 document.getElementById("text").select(); |
|
tkent
2014/04/11 06:27:17
We need .focus() prior to every select(). Withou
harpreet.sk
2014/04/11 07:33:02
Added focus().
| |
| 11 document.execCommand("Copy"); | 11 document.execCommand("Copy"); |
| 12 | 12 |
| 13 // Try to copy a password | 13 // Try to copy a password |
| 14 document.getElementById("password").focus(); | 14 document.getElementById("password").select(); |
| 15 document.execCommand("Copy"); | 15 document.execCommand("Copy"); |
| 16 | 16 |
| 17 // Paste | 17 // Paste |
| 18 document.getElementById("text").focus(); | 18 document.getElementById("text").select(); |
| 19 document.execCommand("Paste"); | 19 document.execCommand("Paste"); |
| 20 | 20 |
| 21 shouldBe('document.getElementById("text").value', '"[not modified]"' ); | 21 shouldBe('document.getElementById("text").value', '"[not modified]"' ); |
| 22 } | 22 } |
| 23 </script> | 23 </script> |
| 24 </head> | 24 </head> |
| 25 <body onload="test()"> | 25 <body onload="test()"> |
| 26 <p>This test verifies that copying is disabled for password fields by at tempting to | 26 <p>This test verifies that copying is disabled for password fields by at tempting to |
| 27 copy from a password field and paste into a textfield. If the test | 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 rem ain unmodified.</p> | 28 passes, you'll see a of 'PASS' message below, and the textfield will rem ain unmodified.</p> |
| 29 <p>(The test is only meaningful in debug builds, since paste is disabled in release builds.)</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"> | 30 <input type="password" id="password" value="Password Input"> |
| 31 <input type="text" id="text" value="[not modified]"> | 31 <input type="text" id="text" value="[not modified]"> |
| 32 <hr> | 32 <hr> |
| 33 <p id="console"></p> | 33 <p id="console"></p> |
| 34 </body> | 34 </body> |
| 35 </html> | 35 </html> |
| OLD | NEW |