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

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

Issue 1807123002: Convert textarea-paste-newline.html to the testharness.js style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <div id="log"></div>
5 <textarea id="ta"></textarea>
1 <script> 6 <script>
2 function test() 7 test(function() {
3 {
4 if (window.testRunner)
5 testRunner.dumpAsText();
6 var ta = document.getElementById("ta"); 8 var ta = document.getElementById("ta");
7 ta.value = "abc\n"; 9 ta.value = "abc\n";
8 ta.focus(); 10 ta.focus();
9 ta.setSelectionRange(0, 4); 11 ta.setSelectionRange(0, 4);
10 document.execCommand("cut"); 12 document.execCommand("cut");
11 document.execCommand("paste"); 13 document.execCommand("paste");
12 var result1 = ta.value; 14 assert_equals(ta.value, "abc\n");
15
13 ta.setSelectionRange(0, 0); 16 ta.setSelectionRange(0, 0);
14 document.execCommand("paste"); 17 document.execCommand("paste");
15 var result2 = ta.value; 18 assert_equals(ta.value, "abc\nabc\n");
16 19 }, "Pasting text ending with newline should work correctly.");
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> 20 </script>
25 <body onload="test()">
26 <p><textarea id="ta"></textarea></p>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698