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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/vertical-rl-rtl-extend-line-backward-p.html

Issue 1466543003: Use w3c test harness in editing/selection/vertical-*.html tests 3/3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-24T15:09:03 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/vertical-rl-rtl-extend-line-backward-p.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/vertical-rl-rtl-extend-line-backward-p.html b/third_party/WebKit/LayoutTests/editing/selection/vertical-rl-rtl-extend-line-backward-p.html
index 4f87284f080e1d8c66fd5ca477d64d4cec1b4388..bc56bbbe6ee23e70604666299b1383df1d3099f8 100644
--- a/third_party/WebKit/LayoutTests/editing/selection/vertical-rl-rtl-extend-line-backward-p.html
+++ b/third_party/WebKit/LayoutTests/editing/selection/vertical-rl-rtl-extend-line-backward-p.html
@@ -1,21 +1,24 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8">
-<style> .selected { color: blue; } </style>
-</head>
-<body>
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<p>This tests horizontal caret movement in vertical writing mode.</p>
<div id="test" style="font-family: monospace; font-size: 20px; height: 15ex; -webkit-writing-mode: vertical-rl;-webkit-text-orientation:sideways-right;text-rendering:optimizeLegibility; outline: none;" contenteditable>
-<p dir="rtl">אני חתול.</p><p dir="rtl">אין לי שם.</p>
+<p id="p1" dir="rtl">אני חתול.</p><p id="p2" dir="rtl">אין לי שם.</p>
</div>
-<pre id="log"></pre>
+<div id="log"></div>
<script>
+test(function() {
+ var selection = window.getSelection();
+ var p1 = document.getElementById('p1');
+ var p2 = document.getElementById('p2');
+ selection.collapse(p2.firstChild, 5);
+ selection.modify('Extend', 'Backward', 'Line');
-var test = document.getElementById('test');
-window.getSelection().collapse(test.getElementsByTagName('p')[1].lastChild, 5);
-window.getSelection().modify('Extend', 'Backward', 'Line');
-
+ assert_false(selection.isCollapsed, 'isCollapsed');
+ assert_equals(selection.anchorNode, p2.firstChild, 'anchorNode');
+ assert_equals(selection.anchorOffset, 5, 'anchorOffset');
+ assert_equals(selection.focusNode, p1.firstChild, 'focusNode');
+ assert_equals(selection.focusOffset, 5, 'focusOffset');
+});
</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698