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