Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / search-cancel-button-mouseup.html
blob97c7aabcef01134b114019d1e4ea8cce74bfc8da
1 <html>
2 <head>
3 <title></title>
4 <script src="resources/common.js"></script>
5 <script>
6 function test()
8 if (!window.testRunner)
9 return;
11 testRunner.dumpAsText();
13 var s1 = document.getElementById("search1");
14 var s2 = document.getElementById("search2");
15 var s3 = document.getElementById("search3");
17 var s1cancelPos = searchCancelButtonPosition(s1);
18 var buttonX = s1cancelPos.x;
19 var middleX = s1.offsetLeft + s1.offsetWidth / 2;
21 var y2 = s2.offsetTop + s2.offsetHeight / 2;
22 var y3 = s3.offsetTop + s3.offsetHeight / 2;
24 eventSender.mouseMoveTo(buttonX, s1cancelPos.y);
25 eventSender.mouseDown();
26 eventSender.mouseMoveTo(middleX, s1cancelPos.y);
27 eventSender.mouseUp();
28 eventSender.leapForward(1000);
30 eventSender.mouseMoveTo(middleX, y2);
31 eventSender.mouseDown();
32 eventSender.mouseMoveTo(buttonX, y2);
33 eventSender.mouseUp();
34 eventSender.leapForward(1000);
36 eventSender.mouseMoveTo(buttonX, y3);
37 eventSender.mouseDown();
38 eventSender.mouseMoveTo(buttonX, y3);
39 eventSender.mouseUp();
41 var result = document.getElementById("result");
42 var values = s1.value + ", " + s2.value + ", " + s3.value;
43 if (values == "foo, bar, ")
44 result.innerText = "PASS";
45 else
46 result.innerText = "FAIL (" + values + ")";
48 </script>
49 </head>
50 <body onload="test()">
51 <p>
52 Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=12618">http://bugs.webkit.org/show_bug.cgi?id=12618</a>
53 REGRESSION (SearchField): Dragging across the text and releasing over the clear button clears the field</i>.
54 </p>
55 <p id="result">
56 Cannot run interactively.
57 </p>
58 <input id="search1" type="search" value="foo">
59 <br>
60 <input id="search2" type="search" value="bar">
61 <br>
62 <input id="search3" type="search" value="baz">
63 </body>
64 </html>