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

Unified Diff: third_party/WebKit/LayoutTests/scrollbars/scrollable-iframe-click-gets-focus.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/scrollable-iframe-click-gets-focus.html
diff --git a/third_party/WebKit/LayoutTests/scrollbars/scrollable-iframe-click-gets-focus.html b/third_party/WebKit/LayoutTests/scrollbars/scrollable-iframe-click-gets-focus.html
index 2b0b595210422fde0ef77881735031f703549e64..29618d7d81fc52cac4d8db7f44b462bf045293af 100644
--- a/third_party/WebKit/LayoutTests/scrollbars/scrollable-iframe-click-gets-focus.html
+++ b/third_party/WebKit/LayoutTests/scrollbars/scrollable-iframe-click-gets-focus.html
@@ -1,33 +1,24 @@
<!DOCTYPE html>
+<title>For the bug that click on the green strip in the scrollable iframe will not make the iframe get the focus. crbug.com/531929</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
<input id='textField' type='text' style="position:relative;"> <br>
Srirama 2016/08/10 12:00:25 nit: space after ":" here and below
MuVen 2016/08/10 12:30:30 Done.
-<iframe onload="runTest();" id="anIFrame" style="left:50px;width:200px;height:200px;position:absolute;" src="resources/scrollable-iframe-with-click-strip.html"> </iframe>
-<script src="../resources/js-test.js"></script>
+<iframe style="left:50px;width:200px;height:200px;position:absolute;" src="resources/scrollable-iframe-with-click-strip.html"> </iframe>
<script>
+async_test(function(t) {
+ var iframe = document.querySelector("iframe");
+ iframe.onload = t.step_func_done(function() {
+ document.getElementById("textField").focus();
Srirama 2016/08/10 12:00:25 may be use querySelector her and remove id from in
MuVen 2016/08/10 12:30:30 Done.
+ var strip = iframe.contentDocument.getElementById("strip");
-setPrintTestResultsLazily();
-description("For the bug that click on the green strip in the scrollable iframe will not make the iframe get the focus. crbug.com/531929")
+ var x = iframe.offsetLeft + strip.offsetLeft + 5;
+ var y = iframe.offsetTop + 5;
-window.jsTestIsAsync = true;
-
-function runTest() {
- document.getElementById("textField").focus();
- if (window.eventSender) {
- var frame = document.getElementById("anIFrame");
- var frame_doc = window.frames[0].document;
- var strip = frame_doc.getElementById("strip");
-
- var x = frame.offsetLeft + strip.offsetLeft + 5;
- var y = frame.offsetTop + 5;
-
- // send mouse event to click iframe's green strip;
- eventSender.mouseMoveTo(x, y);
- eventSender.mouseDown();
- eventSender.mouseUp();
- if (window.frames[0].document.hasFocus())
- debug("PASS");
- else
- debug("FAIL");
- }
- finishJSTest();
-}
+ // send mouse event to click iframe's green strip;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ assert_true(window.frames[0].document.hasFocus());
Srirama 2016/08/10 12:00:25 take iframe.contentDocument in a variable and use
+ });
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698