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..b844be411b0a99be0f4582c3ebd8a387a8086620 100644 |
--- a/third_party/WebKit/LayoutTests/scrollbars/drag-rtl-resizer.html |
+++ b/third_party/WebKit/LayoutTests/scrollbars/drag-rtl-resizer.html |
@@ -1,42 +1,27 @@ |
<!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 node = document.getElementById('overflow'); |
+ var offsetWidth = node.offsetWidth; |
var offsetLeft = node.offsetLeft + 5; |
var offsetTop = node.offsetTop + node.offsetHeight - 5; |
eventSender.mouseMoveTo(offsetLeft, offsetTop); |
eventSender.mouseDown(); |
eventSender.mouseMoveTo(offsetLeft - 30, offsetTop); |
eventSender.mouseUp(); |
- setTimeout(finished, 0); |
-} |
+ setTimeout(t.step_func_done(function() { |
+ assert_greater_than(node.offsetWidth, offsetWidth); |
+ }), 0); |
+}); |
</script> |
</body> |
-</html> |