Chromium Code Reviews| Index: LayoutTests/fast/selectors/label-selection.html |
| diff --git a/LayoutTests/fast/selectors/label-selection.html b/LayoutTests/fast/selectors/label-selection.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6d2385f03f0cd59c27ad4ec0c6f1000ad0bcc73e |
| --- /dev/null |
| +++ b/LayoutTests/fast/selectors/label-selection.html |
| @@ -0,0 +1,47 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script> |
| +function log(msg) |
|
tkent
2014/04/29 23:36:09
Please remove this function, include ../../resourc
deepak.sa
2014/05/02 06:18:46
Done.
|
| +{ |
| + document.getElementById('console').appendChild(document.createTextNode(msg + '\n')); |
| +} |
| + |
| +function testWithDoubleClick(element) |
| +{ |
| + eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| +} |
| + |
| +function checkSelection() |
| +{ |
| + if ((window.getSelection().toString() == "Some")) |
| + log("PASS selected text is :\"" + window.getSelection().toString() + "\""); |
|
tkent
2014/04/29 23:36:09
Please use shouldBeEqualToString() defined in js-t
deepak.sa
2014/05/02 06:18:46
Done.
|
| + else |
| + log("FAIL selected text is :\"" + window.getSelection().toString() + "\""); |
| +} |
| + |
| +function test() |
| +{ |
| + if (window.testRunner) { |
| + var labelElement = document.getElementById("labelWithInput"); |
| + testRunner.dumpAsText(); |
| + testWithDoubleClick(labelElement); |
| + checkSelection(); |
| + |
| + document.getElementById('labelWithInput').style.display = "none"; |
| + } else |
| + log("This test needs window.testRunner and window.eventSender to work."); |
| +} |
| + |
| +</script> |
| +</head> |
| +<body onload="test()"> |
| +<label id="labelWithInput" for="inputText">Some Text associated with input</label> |
| +<input id="inputText" type='text'></input> |
|
keishi
2014/04/30 01:13:14
nit: input should not have an end tag.
deepak.sa
2014/05/02 06:18:46
Done.
|
| +<pre id="console"></pre> |
| +</body> |
| +</html> |