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> |