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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/textarea-paste-newline.html

Issue 1522803002: Move textarea-related tests to fast/forms/textarea/, part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@color-uaf
Patch Set: Created 5 years 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
(Empty)
1 <script>
2 function test()
3 {
4 if (window.testRunner)
5 testRunner.dumpAsText();
6 var ta = document.getElementById("ta");
7 ta.value = "abc\n";
8 ta.focus();
9 ta.setSelectionRange(0, 4);
10 document.execCommand("cut");
11 document.execCommand("paste");
12 var result1 = ta.value;
13 ta.setSelectionRange(0, 0);
14 document.execCommand("paste");
15 var result2 = ta.value;
16
17 if (result1 == "abc\n" && result2 == "abc\nabc\n")
18 document.write("<p>Hooray, the test was successful!</p>");
19 else if (result1 == "")
20 document.write("<p>The test failed; doesn't work in release builds of Sa fari because paste is not allowed.</p>");
21 else
22 document.write("<p>The test failed, result 1 was '" + result1.replace("\ n", "\\n") + "' and result 2 was '" + result2.replace("\n", "\\n") + "'.</p>");
23 }
24 </script>
25 <body onload="test()">
26 <p><textarea id="ta"></textarea></p>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698