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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html b/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html
index 8a52a9d54a56b7195f8b1c19cdafbfea30c77a03..6abc16776cad5a86d7ae0889d608f1cf07d24ca9 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-paste-newline.html
@@ -1,26 +1,20 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<textarea id="ta"></textarea>
<script>
-function test()
-{
- if (window.testRunner)
- testRunner.dumpAsText();
+test(function() {
var ta = document.getElementById("ta");
ta.value = "abc\n";
ta.focus();
ta.setSelectionRange(0, 4);
document.execCommand("cut");
document.execCommand("paste");
- var result1 = ta.value;
+ assert_equals(ta.value, "abc\n");
+
ta.setSelectionRange(0, 0);
document.execCommand("paste");
- var result2 = ta.value;
-
- if (result1 == "abc\n" && result2 == "abc\nabc\n")
- document.write("<p>Hooray, the test was successful!</p>");
- else if (result1 == "")
- document.write("<p>The test failed; doesn't work in release builds of Safari because paste is not allowed.</p>");
- else
- document.write("<p>The test failed, result 1 was '" + result1.replace("\n", "\\n") + "' and result 2 was '" + result2.replace("\n", "\\n") + "'.</p>");
-}
+ assert_equals(ta.value, "abc\nabc\n");
+}, "Pasting text ending with newline should work correctly.");
</script>
-<body onload="test()">
-<p><textarea id="ta"></textarea></p>
« 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