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

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: Addressed 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/scrollbars/drag-rtl-resizer-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/scrollbars/drag-rtl-resizer-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698