Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: LayoutTests/editing/pasteboard/copy-in-password-field.html

Issue 222023002: focus() behaviour differs depending on how value is set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebasing Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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").focus();
11 document.getElementById("text").select();
11 document.execCommand("Copy"); 12 document.execCommand("Copy");
12 13
13 // Try to copy a password 14 // Try to copy a password
14 document.getElementById("password").focus(); 15 document.getElementById("password").focus();
16 document.getElementById("password").select();
15 document.execCommand("Copy"); 17 document.execCommand("Copy");
16 18
17 // Paste 19 // Paste
18 document.getElementById("text").focus(); 20 document.getElementById("text").focus();
21 document.getElementById("text").select();
19 document.execCommand("Paste"); 22 document.execCommand("Paste");
20 23
21 shouldBe('document.getElementById("text").value', '"[not modified]"' ); 24 shouldBe('document.getElementById("text").value', '"[not modified]"' );
22 } 25 }
23 </script> 26 </script>
24 </head> 27 </head>
25 <body onload="test()"> 28 <body onload="test()">
26 <p>This test verifies that copying is disabled for password fields by at tempting to 29 <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 30 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> 31 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> 32 <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"> 33 <input type="password" id="password" value="Password Input">
31 <input type="text" id="text" value="[not modified]"> 34 <input type="text" id="text" value="[not modified]">
32 <hr> 35 <hr>
33 <p id="console"></p> 36 <p id="console"></p>
34 </body> 37 </body>
35 </html> 38 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/editing/pasteboard/copy-in-password-field-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698