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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/5497643.html

Issue 1455413002: Make some editing layout test files to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-19T12:41:19 Created 5 years, 1 month 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
Index: third_party/WebKit/LayoutTests/editing/selection/5497643.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/5497643.html b/third_party/WebKit/LayoutTests/editing/selection/5497643.html
index 90de6df1f7aeb341bb06c8877a977ed0f9a4c398..f39d814b021869cd15007d2e57eef9fc2e24318b 100644
--- a/third_party/WebKit/LayoutTests/editing/selection/5497643.html
+++ b/third_party/WebKit/LayoutTests/editing/selection/5497643.html
@@ -1,15 +1,16 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<p>This tests to make sure that a selection inside a textarea is updated when the textarea is removed from the document.</p>
<textarea id="textarea"></textarea>
+<div id="log"></div>
<script>
-if (window.testRunner)
- window.testRunner.dumpAsText();
textarea = document.getElementById("textarea");
textarea.setSelectionRange(0, 0);
textarea.parentNode.removeChild(textarea);
-if (window.getSelection().type == 'Caret' &&
- window.getSelection().getRangeAt(0).startContainer == document.body &&
- window.getSelection().getRangeAt(0).startOffset == 2)
- alert("SUCCESS: Selection is set to position 2 of BODY.")
-else
- alert("FAILURE: The selection is not set correctly after textarea was deleted.")
+test(function() {
+ assert_equals(window.getSelection().type, 'Caret');
+ assert_equals(window.getSelection().getRangeAt(0).startContainer, document.body);
+ assert_equals(window.getSelection().getRangeAt(0).startOffset, 2);
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698