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

Side by Side 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>For the bug that click on the green strip in the scrollable iframe will n ot make the iframe get the focus. crbug.com/531929</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
2 <input id='textField' type='text' style="position:relative;"> <br> 5 <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.
3 <iframe onload="runTest();" id="anIFrame" style="left:50px;width:200px;height:20 0px;position:absolute;" src="resources/scrollable-iframe-with-click-strip.html"> </iframe> 6 <iframe style="left:50px;width:200px;height:200px;position:absolute;" src="resou rces/scrollable-iframe-with-click-strip.html"> </iframe>
4 <script src="../resources/js-test.js"></script>
5 <script> 7 <script>
8 async_test(function(t) {
9 var iframe = document.querySelector("iframe");
10 iframe.onload = t.step_func_done(function() {
11 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.
12 var strip = iframe.contentDocument.getElementById("strip");
6 13
7 setPrintTestResultsLazily(); 14 var x = iframe.offsetLeft + strip.offsetLeft + 5;
8 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") 15 var y = iframe.offsetTop + 5;
9 16
10 window.jsTestIsAsync = true; 17 // send mouse event to click iframe's green strip;
11 18 eventSender.mouseMoveTo(x, y);
12 function runTest() { 19 eventSender.mouseDown();
13 document.getElementById("textField").focus(); 20 eventSender.mouseUp();
14 if (window.eventSender) { 21 assert_true(window.frames[0].document.hasFocus());
Srirama 2016/08/10 12:00:25 take iframe.contentDocument in a variable and use
15 var frame = document.getElementById("anIFrame"); 22 });
16 var frame_doc = window.frames[0].document; 23 });
17 var strip = frame_doc.getElementById("strip");
18
19 var x = frame.offsetLeft + strip.offsetLeft + 5;
20 var y = frame.offsetTop + 5;
21
22 // send mouse event to click iframe's green strip;
23 eventSender.mouseMoveTo(x, y);
24 eventSender.mouseDown();
25 eventSender.mouseUp();
26 if (window.frames[0].document.hasFocus())
27 debug("PASS");
28 else
29 debug("FAIL");
30 }
31 finishJSTest();
32 }
33 </script> 24 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698