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

Unified Diff: third_party/WebKit/LayoutTests/scrollbars/drag-rtl-resizer.html

Issue 2234773003: convert LayoutTest/scrollbars/* js-test.js tests to testharness.js based tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/drag-rtl-resizer.html
diff --git a/third_party/WebKit/LayoutTests/scrollbars/drag-rtl-resizer.html b/third_party/WebKit/LayoutTests/scrollbars/drag-rtl-resizer.html
index 420b85a246f01c3ddb2555aaebbfedc2648a2810..bd9e9f00fa08c2de7f3af01d619945f7cb545a9d 100644
--- a/third_party/WebKit/LayoutTests/scrollbars/drag-rtl-resizer.html
+++ b/third_party/WebKit/LayoutTests/scrollbars/drag-rtl-resizer.html
@@ -1,33 +1,17 @@
<!DOCTYPE html>
-<html>
-<head>
-<title>Bug 9223</title>
-<script src="../resources/js-test.js"></script>
-</head>
-<body dir="rtl" style="margin:0px">
-<div id="overflow" dir="rtl" style="border:2px solid black; overflow:auto; width: 400px; height: 400px; resize:both;">
-<div style="background-color:red;height:720px"></div>
-<div style="background-color:green;height:1600px"></div>
+<title>Bug 9223: Test that an RTL element renders a resizer to its bottom-left corner and dragging this resizer to the left changes its width. To test manually, dragging the resizer of the below element to left, and see this element increases its width.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<body dir="rtl" style="margin: 0px">
+<div id="overflow" dir="rtl" style="border: 2px solid black; overflow: auto; width: 400px; height: 400px; resize: both;">
+<div style="background-color: red; height: 720px"></div>
+<div style="background-color: green; height: 1600px"></div>
</div>
<script>
-description('Test that an RTL element renders a resizer to its bottom-left corner and ' +
- 'dragging this resizer to the left changes its width. ' +
- 'To test manually, dragging the resizer of the below element to left, and ' +
- 'see this element increases its width.');
-
-// This test must be async because it needs to wait for WebKit to finish re-layouting elements
-// after sending mouse events.
-jsTestIsAsync = true;
-
-function finished()
-{
- shouldBeTrue('document.getElementById(\'overflow\').offsetWidth > offsetWidth');
- finishJSTest();
-}
-
-var offsetWidth = document.getElementById('overflow').offsetWidth;
-
-if (window.eventSender) {
+async_test(function(t) {
+ // This test must be async because it needs to wait for WebKit to finish
+ // re-layouting elements after sending mouse events.
+ var offsetWidth = document.getElementById('overflow').offsetWidth;
var node = document.getElementById('overflow');
var offsetLeft = node.offsetLeft + 5;
var offsetTop = node.offsetTop + node.offsetHeight - 5;
@@ -35,8 +19,9 @@ if (window.eventSender) {
eventSender.mouseDown();
eventSender.mouseMoveTo(offsetLeft - 30, offsetTop);
eventSender.mouseUp();
- setTimeout(finished, 0);
-}
+ setTimeout(t.step_func_done(function() {
+ assert_greater_than(document.getElementById('overflow').offsetWidth, offsetWidth);
Srirama 2016/08/10 12:00:25 nit: you can use node.offsetWidth here.
+ }), 0);
+});
</script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698