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

Unified Diff: third_party/WebKit/LayoutTests/scrollbars/rtl/div-horizontal.html

Issue 2229393002: convert LayoutTest/scrollbars/rtl/* js-test.js tests to testharness.js based tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed div-absolute-expected in virtual folder 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/scrollbars/rtl/div-horizontal.html
diff --git a/third_party/WebKit/LayoutTests/scrollbars/rtl/div-horizontal.html b/third_party/WebKit/LayoutTests/scrollbars/rtl/div-horizontal.html
index e2ff7f8b67e69f096779e4a10fcfa272ee3d4226..2837f7d36e88779bb574e689ce3d8c87768262ae 100644
--- a/third_party/WebKit/LayoutTests/scrollbars/rtl/div-horizontal.html
+++ b/third_party/WebKit/LayoutTests/scrollbars/rtl/div-horizontal.html
@@ -1,9 +1,7 @@
<!DOCTYPE html>
-<html>
-<head>
-<title>Bug 85856</title>
-<script src="../../resources/js-test.js"></script>
-</head>
+<title>Bug 85856: Test if WebKit can show the left side of the inner elements regardless of the position of its scrollbars. To test manually, open this document and verify we can see "ABC" both in the LTR element and in the RTL element.</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<body dir="ltr">
<div dir="ltr" id="outer-ltr" style="width: 200px; height: 200px; overflow: scroll;">
<div id="inner-ltr" style="text-align: left; width: 300px; height: 300px;">ABC</div>
@@ -11,30 +9,29 @@
<div dir="rtl" id="outer-rtl" style="width: 200px; height: 200px; overflow: scroll;">
<div id="inner-rtl" style="text-align: left; width: 300px; height: 300px;">ABC</div>
</div>
-<script type="text/javascript">
-description('Test if WebKit can show the left side of the inner elements regardless of the position of its scrollbars. To test manually, open this document and verify we can see "ABC" both in the LTR element and in the RTL element.');
+<script>
+test(function() {
+ var outerLTR = document.getElementById("outer-ltr");
+ var innerLTR = document.getElementById("inner-ltr");
+ var outerRTL = document.getElementById("outer-rtl");
+ var innerRTL = document.getElementById("inner-rtl");
+ outerLTR.scrollLeft = 0;
+ outerRTL.scrollLeft = 0;
-var outerLTR = document.getElementById('outer-ltr');
-var innerLTR = document.getElementById('inner-ltr');
-var outerRTL = document.getElementById('outer-rtl');
-var innerRTL = document.getElementById('inner-rtl');
-outerLTR.scrollLeft = 0;
-outerRTL.scrollLeft = 0;
+ // Verify the widths of the outer RTL elements are the same as the widths of the outer LTR elements.
+ assert_equals(outerLTR.offsetWidth, outerRTL.offsetWidth);
+ assert_equals(outerLTR.clientWidth, outerRTL.clientWidth);
+ assert_equals(outerLTR.scrollWidth, outerRTL.scrollWidth);
-debug('Verify the widths of the outer RTL elements are the same as the widths of the outer LTR elements.');
-shouldBeTrue('outerLTR.offsetWidth == outerRTL.offsetWidth');
-shouldBeTrue('outerLTR.clientWidth == outerRTL.clientWidth');
-shouldBeTrue('outerLTR.scrollWidth == outerRTL.scrollWidth');
+ // Verify the widths of the inner RTL elements are the same as the widths of the inner LTR elements.
+ assert_equals(innerLTR.offsetWidth, innerRTL.offsetWidth);
+ assert_equals(innerLTR.clientWidth, innerRTL.clientWidth);
+ assert_equals(innerLTR.scrollWidth, innerRTL.scrollWidth);
-debug('Verify the widths of the inner RTL elements are the same as the widths of the inner LTR elements.');
-shouldBeTrue('innerLTR.offsetWidth == innerRTL.offsetWidth');
-shouldBeTrue('innerLTR.clientWidth == innerRTL.clientWidth');
-shouldBeTrue('innerLTR.scrollWidth == innerRTL.scrollWidth');
-
-debug('Verify the width of the vertical scrollbar of the outer RTL element is the same as the one of the outer LTR element regardless of their scrollbar positions.');
-var scrollbarWidthLTR = outerLTR.offsetWidth - outerLTR.clientWidth;
-var scrollbarWidthRTL = outerRTL.offsetWidth - outerRTL.clientWidth;
-shouldBeTrue('scrollbarWidthLTR == scrollbarWidthRTL');
+ // Verify the width of the vertical scrollbar of the outer RTL element is the same as the one of the outer LTR element regardless of their scrollbar positions.
+ var scrollbarWidthLTR = outerLTR.offsetWidth - outerLTR.clientWidth;
+ var scrollbarWidthRTL = outerRTL.offsetWidth - outerRTL.clientWidth;
+ assert_equals(scrollbarWidthLTR, scrollbarWidthRTL);
+});
</script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698