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

Unified Diff: third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-1.html

Issue 2260763002: Convert LayoutTests/svg/text/* js-tests.js tests to testharness.js based tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Align with review comments Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-1.html
diff --git a/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-1.html b/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-1.html
index 18f28587031b3f470b90d38e9741c94a5ec39a83..a06eee88adcb3665912c4c18da91d4a160ada391 100644
--- a/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-1.html
+++ b/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-1.html
@@ -1,4 +1,5 @@
<!DOCTYPE html>
+<title>Text Selection when dragging mouse outside the SVG text element</title>
<style>
text {
font: 10px Arial;
@@ -12,32 +13,25 @@ text {
</g>
<text id="line" x="130" y="150">Hello World. Hello, SVG.</text>
</svg>
-<script src="../../resources/js-test.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<script src="resources/SelectionTestCase.js"></script>
-<script type="text/javascript">
-function getEndPosition(id, offset, gap) {
- var element = document.getElementById(id);
- var endPos = element.getEndPositionOfChar(offset);
- endPos.x += gap.x;
- endPos.y += gap.y;
- var absEndPos = toAbsoluteCoordinates(endPos, element);
- return absEndPos;
-}
-
-selectTextFromCharToPoint({ id: 'line', offset: 0 }, { x: 400, y: 400 }, { startElementId: 'line', start: "0", endElementId: "line", end: "24" });
-selectTextFromCharToPoint({ id: 'line', offset: 7 }, { x: 400, y: 400 }, { startElementId: "line", start: "7", endElementId: "line", end: "24" });
-
-var absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 0});
-selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: "0", endElementId: "firsttext", end: "4"});
-absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 10});
-selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: "0", endElementId: "middletext", end: "4"});
-absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 20});
-selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: "0", endElementId: "middletext", end: "4"});
-absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 30});
-selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: "0", endElementId: "endtext", end: "4"});
-absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 40});
-selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: "0", endElementId: "endtext", end: "4"});
-absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 50});
-selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: "0", endElementId: "endtext", end: "4"});
+<script>
+test(function() {
+ selectTextFromCharToPoint({ id: 'line', offset: 0 }, { x: 400, y: 400 }, { startElementId: 'line', start: 0, endElementId: "line", end: 24 });
+ selectTextFromCharToPoint({ id: 'line', offset: 7 }, { x: 400, y: 400 }, { startElementId: "line", start: 7, endElementId: "line", end: 24 });
+ var absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 0});
+ selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: 0, endElementId: "firsttext", end: 4});
+ absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 10});
+ selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: 0, endElementId: "middletext", end: 4});
+ absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 20});
+ selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: 0, endElementId: "middletext", end: 4});
+ absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 30});
+ selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: 0, endElementId: "endtext", end: 4});
+ absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 40});
+ selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: 0, endElementId: "endtext", end: 4});
+ absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 50});
+ selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElementId: 'firsttext', start: 0, endElementId: "endtext", end: 4});
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698